RFR: 8318200: String::newStringNoRepl and String::getBytesNoRepl does not throw CharacterCodingException [v5]

Alan Bateman alanb at openjdk.org
Wed Oct 18 16:43:19 UTC 2023


On Wed, 18 Oct 2023 16:27:58 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> The new usages that are driving this change would be better served by a method dedicated to creating latin1 strings from a caller provided byte array. The JavaLangAccess shared secret interface is already overused, but it is cleaner, more maintainable, and fit for purpose to add a method than to contort the exception handling as proposed.

We have to be very careful with proposals like this as it means code outside of java.lang having access to the underlying bytes. I think other alternatives needs to be explored to avoid this and related concerns.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16209#issuecomment-1768937914


More information about the security-dev mailing list