On Fri, 5 Sep 2025 20:32:20 GMT, Justin Lu <[email protected]> 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.
>
> Justin Lu has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Retain hex dump and test against older versions directly

LGTM. Thanks for revisiting the serialization tests.

test/jdk/java/text/Format/DecimalFormat/DecimalFormat.114.txt line 2:

> 1: #
> 2: # Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights 
> reserved.

Nit: since the content of the file has not changed, I don't think we need to 
update the year

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

PR Review: https://git.openjdk.org/jdk/pull/27108#pullrequestreview-3190796488
PR Review Comment: https://git.openjdk.org/jdk/pull/27108#discussion_r2326054684

Reply via email to