Integrated: 8366733: Re-examine older java.text NF, DF, and DFS serialization tests

Justin Lu jlu at openjdk.org
Tue Sep 9 22:07:29 UTC 2025


On Thu, 4 Sep 2025 22:03:51 GMT, Justin Lu <jlu at openjdk.org> wrote:

> This PR cleans up the existing DecimalFormatSymbols, DecimalFormat, and NumberFormat serialization tests.
> 
> As mentioned in https://github.com/openjdk/jdk/pull/27008 these tests can be re-visited.
> 
> These older tests are either not run (since they rely on being run by older JDK versions), rely on hex dump files, or are simply outdated. These are now removed or updated and moved under **DecimalFormat/SerializationTest.java** and **DFSSerializationTest.java**. Additionally, tests to check the stream version invariants are added for DecimalFormat.
> 
> Below are the existing tests that are removed or modified. (Their associated hex dump files are removed as well).
> 
> **DFSDeserialization142.java & DFSSerialization142.java** (D)
> 
> -  They do not have Jtreg headers and are not run. The comments indicate they require a specific JDK version of 1.4.2. Instead, a currency symbol test is added in place.
> 
> **NumberFormat/DFSSerialization.java** (D)
> 
> - Test 1 checks if a DFS written from a 1.4.2 JDK with stream version of 2 when read has the correct String exponent and currency symbol. -> There is an existing test which checks the exponent. A New test is added in place of currency symbol test.
> - Test 2 checks that a DFS maintains the exponent separator and currency symbol when read. -> Tests are added in place of them of them.
> - Test 3 is unrelated to de serialization, and checks that the exponent separator symbol setter throws NPE. -> Test 3 is already covered by **SettersShouldThrowNPETest.java**.
> 
> **SerializationLoad.java & SerializationSave.java** (D)
> 
> -  The save test depends on JDK 1.1.4, and is the code to write a DFS and DF. (It has no header and is not run.) The load test uses the saved 1.1.4 hex dump file to ensure the DFS and DF can be read, it did not check any specific invariants.
> 
> **NumberRegression.java** (M)
> 
> - Test4185761 and Test4069754 check NF/DF invariants and are ported to the dedicated serialization test file.

This pull request has now been integrated.

Changeset: 24a73493
Author:    Justin Lu <jlu at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/24a734938e555882857cf0b06ea693ec6f18085f
Stats:     940 lines in 13 files changed: 350 ins; 544 del; 46 mod

8366733: Re-examine older java.text NF, DF, and DFS serialization tests

Reviewed-by: naoto

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

PR: https://git.openjdk.org/jdk/pull/27108


More information about the core-libs-dev mailing list