On Thu, 24 Sep 2026 11:37:41 GMT, Daniel Jeliński <[email protected]> wrote:

> Simplify the system TimeZone retrieval.
> 
> The new code behaves just as before in the most common case where 
> `GetDynamicTimeZoneInformation` returns a known `TimeZoneKeyName`, and 
> reduces the amount of second-guessing when the time zone is not known.
> 
> Method `getGMTOffsetID` was not modified. It is only used as a fallback when 
> `findJavaTZ_md` fails, and while it doesn't look great, it's probably better 
> than most of the alternatives.
> 
> I verified that:
> - the `TimeZoneKeyName` contains non-localized values and is usable on both 
> English and non-English systems,
> - tier1 and tier2 tests continue to pass
> - java/time tests continue to pass when the fallback paths are taken 
> (`findJavaTZ_md` returns a `customZoneName` or a `NULL`)
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.base/windows/native/libjava/TimeZone_md.c line 171:

> 169:         }
> 170:         wcstombs(winZoneName, dtzi.TimeZoneKeyName, MAX_ZONE_CHAR);
> 171:         return VALUE_KEY;

>From what I can see in these changes is that the new code basically ends all 
>fallback logic right around here. All the further registry discovery logic is 
>instead replaced with a custom zone name with the fixed offset.

Does this type of behavior change require a RN? Or is this something too 
obscure to describe, or since the removed path was for older Windows versions, 
it has been non-functional for a long time anyway.

src/java.base/windows/native/libjava/TimeZone_md.c line 219:

> 217: 
> 218:     /*
> 219:      * If DynamicDaylightTime is disabled or TimeZoneKeyName is unknown,

I'd also clarify this comment to mention the third case when there is no match 
found in the tzmappings as indicated by the return value of `matchJavaTZ`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33052#discussion_r4109239809
PR Review Comment: https://git.openjdk.org/jdk/pull/33052#discussion_r4109098062

Reply via email to