RFR: 8356439: Rename JavaLangAccess::*NoRepl methods [v5]
Volkan Yazici
vyazici at openjdk.org
Fri Aug 22 13:26:40 UTC 2025
On Thu, 21 Aug 2025 13:47:03 GMT, Chen Liang <liach at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/String.java line 891:
>>
>>> 889: private static <E extends Exception> byte[] encodeWithEncoder(
>>> 890: Charset cs, byte coder, byte[] val, Class<E> characterCodingException)
>>> 891: throws E {
>>
>> This is a very curious construct; clever in a way but also a bit magical.
>> All the while enabling the caller (using null) to avoid having to declare the exception.
>> If there were a concise explanation, that might be useful to future maintainers.
>
> Indeed, this uses the well-known Java 8 sneaky throws trick.
Totally agreed – documented exception parametrization in 87f831e1c50.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26413#discussion_r2293730019
More information about the security-dev
mailing list