On Mon, 25 May 2026 15:11:22 GMT, Sruthy Jayan <[email protected]> wrote:
>> Modern AIX7+ supports full POSIX TZ format (e.g., >> TZ=CET-1CEST,M3.5.0,M10.5.0), but the current implementation in >> mapPlatformToJavaTimezone() searches the tzmappings file using the complete >> string including DST transition rules. The tzmappings file only contains the >> base timezone identifier (e.g., CET-1CEST), causing the lookup to fail and >> fall back to GMT offset calculation. >> >> This behavior differs from earlier AIX versions and IBM Java 8, which >> truncated the TZ string at the first comma before performing the lookup, >> successfully mapping to proper IANA timezone IDs. >> >> >> Fix include the below : >> Refactor the AIX timezone mapping implementation to support both modern and >> legacy POSIX TZ formats: >> >> Extract mapping logic into new getJavaTimezoneFromPlatform() helper function >> Implement two-phase lookup strategy: >> Phase 1: Attempt to map the full POSIX TZ string (supports modern AIX7+) >> Phase 2: If no match, truncate at first comma and retry (maintains backward >> compatibility) >> Fall back to GMT offset only if both lookups fail >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Sruthy Jayan has updated the pull request incrementally with one additional > commit since the last revision: > > Removed extra whitespaces > > Signed-off-by: Sruthy Jayan <[email protected]> Thanks for the explanation. I think this test and the AIX mapping change are validating different things. The original test is not really proving that java.util.TimeZone preserves the full POSIX TZ rule as a TimeZone. On non-AIX platforms the native code may pass the TZ value through, but java.util.TimeZone only recognizes tzdb IDs and custom GMT offset IDs. For a POSIX string such as MEZ-1MESZ,M3.5.0,M10.5.0/3, the default TimeZone falls back to a GMT offset based on the current platform offset. So the test is effectively a current-offset smoke test against the explicit TZ rule. With the AIX change, however, the comma suffix is discarded and only the prefix is mapped through tzmappings, e.g. CET-1CEST,M3.5.0,M10.5.0 -> CET-1CEST -> Europe/Paris. That means the explicit POSIX transition rules are no longer what determines the result. If that is the intended AIX behavior, then this test seems no longer applicable to AIX. In that case, I think it would be clearer to exclude AIX from this test and add a separate AIX-specific test for the tzmappings fallback behavior, rather than changing this test to accept the mapped timezone result. Otherwise the test summary/bug description should be updated, because it is no longer validating that the explicit DST rules in TZ are honored on AIX. ------------- PR Comment: https://git.openjdk.org/jdk/pull/31270#issuecomment-4594635140
