RFR: 8366400: JCK test api/java_text/DecimalFormat/Parse.html fails after JDK-8363972 [v2]
Naoto Sato
naoto at openjdk.org
Tue Sep 2 22:58:46 UTC 2025
On Tue, 2 Sep 2025 22:15:29 GMT, Justin Lu <jlu at openjdk.org> 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
More information about the core-libs-dev
mailing list