<i18n dev> RFR: 8319640: ClassicFormat::parseObject (from DateTimeFormatter) does not conform to the javadoc and may leak DateTimeException [v2]

Naoto Sato naoto at openjdk.org
Mon Nov 13 18:37:42 UTC 2023


On Fri, 10 Nov 2023 01:20:28 GMT, Joe Wang <joehw at openjdk.org> wrote:

>> Naoto Sato has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>> 
>>  - comment fix
>>  - Addresses review comments
>>  - Merge branch 'master' into JDK-8319640-ClassicFormat-parseObject
>>  - initial commit
>
> test/jdk/java/time/test/java/time/format/TestDateTimeParsing.java line 260:
> 
>> 258:             .toFormatter(Locale.ROOT)
>> 259:             .toFormat();
>> 260:         assertEquals(f.parseObject("17-30", new ParsePosition(0)), null);
> 
> I might have missed it, but this test doesn't seem to exercise the situation where IOOBE would happen. Though the result would be the same as it catches RuntimeException always, I wonder whether an additional test case would be helpful to verify the IOOBE situation, e.g. set the position to be greater than the length.

Thanks, Joe. Added extra test for IOOBE.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16586#discussion_r1391518275


More information about the i18n-dev mailing list