On Tue, 2 Sep 2025 22:15:29 GMT, Justin Lu <[email protected]> wrote:
>> This PR addresses a JCK test failure of an unexpected SIOOBE during
>> DecimalFormat parsing. During the char by char comparison in `matchAffix`,
>> the minimum of the length of the parsed String and the PP index + affix
>> length are iterated on. The parse position index needs to be checked to not
>> be negative to ensure that we do not index the String below 0. Taking the
>> minimum of those two previously mentioned values already guarantees that we
>> do not index the String above the length.
>
> Justin Lu has updated the pull request incrementally with two additional
> commits since the last revision:
>
> - Missing the bug ID in the new test
> - Adding additional tests and moving tests to PositionTest
LGTM. Moving position tests unrelated to lenient minus parsing to here is good.
test/jdk/java/text/Format/NumberFormat/PositionTest.java line 60:
> 58: // begins at the valid portion. Ensure PP is properly updated.
> 59: @Test
> 60: public void modifiedPositionTest() {
JUnit5 tests default to package-private visibility, but I think aligning with
other tests is more important.
-------------
Marked as reviewed by naoto (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/27014#pullrequestreview-3178377182
PR Review Comment: https://git.openjdk.org/jdk/pull/27014#discussion_r2317343019