On Mon, 5 Oct 2026 16:09:13 GMT, Naoto Sato <[email protected]> wrote:

>> src/java.base/share/classes/sun/util/locale/provider/LocaleResources.java 
>> line 374:
>> 
>>> 372:                 offsets.put(entry.substring(0, separator), 
>>> ZoneOffset.of(entry.substring(separator + 1)));
>>> 373:             }
>>> 374:             return offsets;
>> 
>> Suggestion:
>> 
>>             return Map.copyOf(offsets);
>
> The map is not intended to be exposed to clients, so there's no need to 
> create a defensive copy.

The idea was to:
1. Let the method return an immutable collection in all cases
2. Reduce memory consumption ("shrink-wrap" the results)
3. Possibly improve performance by using a read optimized collection

But none of that is critical, it's fine in any case 👍

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33133#discussion_r4186630337

Reply via email to