RFR: 8353197: Document preconditions for JavaLangAccess methods [v2]
Raffaello Giulietti
rgiulietti at openjdk.org
Wed May 7 13:25:18 UTC 2025
On Wed, 7 May 2025 08:02:28 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix typo in pre-existing JavaDoc
>
> src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 355:
>
>> 353: * UTF-16 representation.
>> 354: * <p>
>> 355: * <b>WARNING: This method does not perform any bound checks.</b>
>
> Maybe not this PR but this method is begging to be renamed. It's really hard to audit usage when the method is accessible to faraway code via shared secrets. So maybe not this PR but I think we need an issue in JBS to track renaming, I think Stuart suggested prefixing with "unchecked".
As mentioned by Alan and Jaikiran, at some point it is advisable to prefix the names with "unchecked".
For the "noRepl" names, perhaps the mouthful but clearer "noReplacementChar" might help.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24982#discussion_r2077617931
More information about the security-dev
mailing list