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).

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

Commit messages:
 - JDK-8380993 : AIX: Fix POSIX TZ string mapping in TimeZone_md.c

Changes: https://git.openjdk.org/jdk/pull/31270/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31270&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8380993
  Stats: 89 lines in 2 files changed: 57 ins; 18 del; 14 mod
  Patch: https://git.openjdk.org/jdk/pull/31270.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31270/head:pull/31270

PR: https://git.openjdk.org/jdk/pull/31270

Reply via email to