RFR: 8354522: Clones of DecimalFormat cause interferences when used concurrently [v7]

Naoto Sato naoto at openjdk.org
Wed Apr 16 16:37:52 UTC 2025


On Wed, 16 Apr 2025 15:59:10 GMT, Johannes Graham <duke at openjdk.org> wrote:

>> The `DigitList` class used in `DecimalFormat` does not reset the `data` array in its clone method. This can cause interference when clones are used concurrently.
>
> Johannes Graham has updated the pull request incrementally with one additional commit since the last revision:
> 
>   reflective test

Thanks for adding the test. Let's keep them both.

test/jdk/java/text/Format/DecimalFormat/CloneTest.java line 56:

> 54: 
> 55:         DIGIT_LIST_CLASS = digitList.getClass();
> 56:     }

I'd add some comment saying that this is a whitebox testing, so it might fail if the internal implementation changes (quite unlikely though). And if accessing digitList/data fails, it should throw `jtreg.SkippedException` instead of a real exception in the actual @test methods.

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

PR Review: https://git.openjdk.org/jdk/pull/24598#pullrequestreview-2773165558
PR Review Comment: https://git.openjdk.org/jdk/pull/24598#discussion_r2047318489


More information about the core-libs-dev mailing list