On Sat, 30 Aug 2025 06:41:53 GMT, Alan Bateman <[email protected]> wrote:

>> This PR addresses a JCK test failure related to `DecimalFormatSymbols` 
>> de-serialization. While the current public API of DFS disallows a null 
>> locale, it was possible to set in the past. Thus, the 
>> `loadNumberData(locale)` call currently throws NPE when locale is null in 
>> the stream. The call should be guarded with a null check, such that if 
>> locale is null, then `lenientMinusSigns` defaults to `minusSignText`.
>> 
>> Defaulting the locale field when `null` to Locale.ROOT is also a reasonable 
>> solution, but I think that the current one is preferable as a user would not 
>> expect locale data related logic to occur if locale is `null`.
>
> Have you considered adding a unit or regression test to exercise 
> DecimalFormatSymbols serialization? I assume this issue slipped through and 
> was caught else where because the jdk repo doesn't have any tests for this.

@AlanBateman @naotoj  Initially I relied on the JCK test since this was a 
non-standard situation. But you are right that we should not have to rely on 
the JCK tests to discover an issue in the JDK, I've removed the `noreg-jck` 
label and added a serialization test. It checks all of the correct behavior 
based on the stream version, as well as other invariants. I also filed 
[JDK-8366733](https://bugs.openjdk.org/browse/JDK-8366733) because many of the 
existing serialization tests for DFS seem to be relics and can either be 
removed or are redundant with the newly added test.

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

PR Comment: https://git.openjdk.org/jdk/pull/27008#issuecomment-3246431509

Reply via email to