8064914: tzdb.dat compilation failure when using tzdata2014j
authoraefimov
Mon, 17 Nov 2014 14:11:08 +0300
changeset 27726 34021e900889
parent 27725 433b57a5a5c1
child 27727 ac74c0c65910
8064914: tzdb.dat compilation failure when using tzdata2014j Reviewed-by: sherman, coffeys
jdk/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java
--- a/jdk/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java	Sun Nov 16 15:03:46 2014 +0100
+++ b/jdk/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java	Mon Nov 17 14:11:08 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) {