JDK-8064914 : tzdb.dat compilation failure when using tzdata2014j
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.time
  • Affected Version: 8,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-11-14
  • Updated: 2015-06-04
  • Resolved: 2014-11-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b42Fixed
Related Reports
Relates :  
Description
The following error was observed during compilation of tzdb.dat with latest JDK9 source:
Failed: java.time.zone.ZoneRulesException: Unknown time-zone ID: Africa/Asmera
java.time.zone.ZoneRulesException: Unknown time-zone ID: Africa/Asmera
at build.tools.tzdb.TzdbZoneRulesProvider.getZoneRules(TzdbZoneRulesProvider.java:98)
at build.tools.tzdb.TzdbZoneRulesCompiler.compile(TzdbZoneRulesCompiler.java:194)
at build.tools.tzdb.TzdbZoneRulesCompiler.main(TzdbZoneRulesCompiler.java:89)

The issue was observed during latest tzdata2014j integration (JDK-8064560).
The issue is cause by the following timezone linking behavior:
There is a Zone with name 'Africa/Nairobi' (defined in 'africa' tzdata file). 
The zone link with name 'Africa/Asmara' is defined in the same 'africa' file. This link refers to 'Africa/Nairobi'.
And there is another link with name 'Africa/Asmera' defined in 'backward' tz file. It is linked to 'Africa/Asmara'.
It means that 'Africa/Asmera' linked to 'Africa/Nairobi' through another link (double link chain). 
It seems that the current implementation of Tzdb compiler supports only direct links (link to the zone, but not to another link).
Comments
whoops - looks like we forgot to remove the unused zoneId0 variable. We can keep this in mind next time we come to visit this code. "String zoneId0 = zoneId"
17-11-2014

The following fix solves the problem: diff -r a474ad2dbd9b make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java --- a/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java Fri Nov 14 11:41:42 2014 +0000 +++ b/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java Fri Nov 14 17:40:25 2014 +0300 @@ -95,7 +95,17 @@ obj = zones.get(zoneId); } if (obj == null) { - throw new ZoneRulesException("Unknown time-zone ID: " + zoneId0); + // Timezone link can be located in 'backward' file and it + // can refer to another link, so we need to check for + // link one more time, before throwing an exception + String zoneIdBack = zoneId; + if (links.containsKey(zoneId)) { + zoneId = links.get(zoneId); + obj = zones.get(zoneId); + } + if (obj == null) { + throw new ZoneRulesException("Unknown time-zone ID: " + zoneIdBack); + } } } if (obj instanceof ZoneRules) {
14-11-2014