RFR: 8298033: Character.codePointAt(char[], int, int) doesn't do JavaDoc-specified check [v3]
Sergey Tsypanov
stsypanov at openjdk.org
Sat Dec 3 18:45:00 UTC 2022
On Fri, 2 Dec 2022 21:31:42 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8298033: Fix test
>
> test/jdk/java/lang/Character/Supplementary.java line 808:
>
>> 806: return;
>> 807: }
>> 808: if (expectedException.isInstance(e)) { // Character.codePointBefore() throws
>
> The test should fail without the fix, but this fall-through allows the test to pass.
>
> The qualification added for `isAt` is hiding a second/corresponding bug in `codePointBefore` where the index is not checked and an ArrayIndexOutOfBounds occurs at codePointBeforeImpl: 9488.
Yeah, this AIOOBE is exactly the reason why I added this. So should we modify `codePointBefore` in the same way as `codePointAt`?
-------------
PR: https://git.openjdk.org/jdk/pull/11480
More information about the core-libs-dev
mailing list