On Tue, 7 Apr 2026 00:06:06 GMT, Naoto Sato <[email protected]> wrote:
>> This PR adds support for the std/dstOffset attributes in CLDR metazone
>> definitions. These attributes were introduced in CLDR v48 to address
>> differences between the IANA TZDB vanguard and rearguard formats. At the
>> time JDK adopted CLDR v48, this support was not implemented because the JDK
>> handles these differences separately (see JDK-8212970).
>>
>> More recently, the America/Vancouver time zone is planning to adopt a
>> year-round fixed offset. To avoid mismatches between standard and daylight
>> saving time naming, CLDR has started using these attributes for that zone.
>> This change prepares the JDK for upcoming TZDB updates and the corresponding
>> CLDR changes.
>
> Naoto Sato has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Enabled zone alias
make/jdk/src/classes/build/tools/cldrconverter/MetaZonesParseHandler.java line
88:
> 86: metazone = attributes.getValue("mzone");
> 87:
> 88: // explicit dst offsets
Either here or somewhere else, maybe a comment along the lines of "stdOffset is
not needed since dstOffset alone is sufficient for zone-name handling". I
understand the basis is perhaps obvious, but good to make it explicit in the
code.
src/java.base/share/classes/java/text/SimpleDateFormat.java line 1305:
> 1303: .getLocaleResources(Locale.ROOT)
> 1304: .getTimeZoneNames("metazone.dstoffset." +
> TimeZoneNameUtility.canonicalTZID(tzid).orElse(tzid));
> 1305: boolean daylight = explicitDstOffset != null &&
I think it would be easier to understand it if we just broke it into a
conditional based on the existence of the _explicitDstOffset_ rather than
bundle it up in a single expression. Then if it exists, we can comment that
daylight is derived from it, otherwise fallback. The current logic applies the
`dstOffset != zoneOffset` fallback logic even if _explicitDstOffset_ exists,
which I'm not sure is needed.
src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line
4517:
> 4515: if (!isGeneric) {
> 4516: // check explicit metazone dst offsets
> 4517: String dstOffset =
> (String)LocaleProviderAdapter.forType(LocaleProviderAdapter.Type.CLDR)
Should we make this logic a dedicated method in `TimeZoneNameUtility` since it
is shared by `SimpleDateFormat` as well?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30594#discussion_r3046959396
PR Review Comment: https://git.openjdk.org/jdk/pull/30594#discussion_r3046818058
PR Review Comment: https://git.openjdk.org/jdk/pull/30594#discussion_r3046949477