changeset 8198:5320ab260e96

8037502: build.tools.javazic.Zoneinfo incorrectly calculates raw GMT offset change time Reviewed-by: okutsu
author aefimov
date Tue, 20 Jan 2015 14:59:33 +0300
parents 865cd1b100b7
children 2859f284d086
files make/tools/src/build/tools/javazic/Zoneinfo.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/make/tools/src/build/tools/javazic/Zoneinfo.java	Thu Apr 09 20:46:58 2015 -0700
+++ b/make/tools/src/build/tools/javazic/Zoneinfo.java	Tue Jan 20 14:59:33 2015 +0300
@@ -376,6 +376,7 @@
         ZoneRec zrec = zone.get(zone.size()-1);
         tz.getOffsetIndex(zrec.getGmtOffset());
 
+        int lastGmtOffsetValue = -1;
         int currentSave = 0;
         boolean usedZone;
         for (int zindex = 0; zindex < zone.size(); zindex++) {
@@ -384,9 +385,12 @@
             gmtOffset = zrec.getGmtOffset();
             int stdOffset = zrec.getDirectSave();
 
+            if (gmtOffset != lastGmtOffsetValue) {
+                tz.setRawOffset(gmtOffset, fromTime);
+                lastGmtOffsetValue = gmtOffset;
+            }
             // If this is the last zone record, take the last rule info.
             if (!zrec.hasUntil()) {
-                tz.setRawOffset(gmtOffset, fromTime);
                 if (zrec.hasRuleReference()) {
                     tz.setLastRules(zrec.getRuleRef().getLastRules());
                 } else if (stdOffset != 0) {