hughesjr / rpms / tzdata

Forked from rpms/tzdata 2 years ago
Clone
Blob Blame History Raw
# Patch based on fix in JDK8 tree by Yuka Kamiya from Oracle:
# http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f114bddac6d6

diff -up ./sun/tools/javazic/Mappings.java.sav ./sun/tools/javazic/Mappings.java
--- ./sun/tools/javazic/Mappings.java.sav	2011-11-03 16:31:53.000000000 -0400
+++ ./sun/tools/javazic/Mappings.java	2011-11-03 16:41:44.000000000 -0400
@@ -77,15 +77,17 @@ class Mappings {
 	    int rawOffset = zone.get(zone.size()-1).getGmtOffset();
 	    // If the GMT offset of this Zone will change in some
 	    // future time, this Zone is added to the exclude list.
-	    if (zone.size() > 1) {
-		ZoneRec zrec = zone.get(zone.size()-2);
+	    boolean isExcluded = false;
+	    for (int i = 0; i < zone.size(); i++) {
+		ZoneRec zrec = zone.get(i);
 		if ((zrec.getGmtOffset() != rawOffset)
 		    && (zrec.getUntilTime(0) > Time.getCurrentTime())) {
 		    if (excludeList == null) {
 			excludeList = new ArrayList<String>();
 		    }
 		    excludeList.add(zone.getName());
-		    continue;
+		    isExcluded = true;
+		    break;
 		}
 	    }
 
@@ -101,9 +103,13 @@ class Mappings {
 		rawOffsetsIndex.add(i, rawOffset);
 
 		Set<String> perRawOffset = new TreeSet<String>();
+		if (!isExcluded) {
+		    perRawOffset = new TreeSet<String>();
+		}
+
 		perRawOffset.add(zonename);
 		rawOffsetsIndexTable.add(i, perRawOffset);
-	    } else {
+	    } else if (!isExcluded) {
 		int i = rawOffsetsIndex.indexOf(new Integer(rawOffset));
 		Set<String> perRawOffset = rawOffsetsIndexTable.get(i);
 		perRawOffset.add(zonename);