jdk/test/sun/util/calendar/zi/Zoneinfo.java
changeset 23349 30ea1ad58166
parent 23010 6dadb192ad81
child 40677 8243adf9888e
equal deleted inserted replaced
23348:c6aac3e0bc8f 23349:30ea1ad58166
   370 
   370 
   371         // take the index 0 for the GMT offset of the last zone record
   371         // take the index 0 for the GMT offset of the last zone record
   372         ZoneRec zrec = zone.get(zone.size()-1);
   372         ZoneRec zrec = zone.get(zone.size()-1);
   373         tz.getOffsetIndex(zrec.getGmtOffset());
   373         tz.getOffsetIndex(zrec.getGmtOffset());
   374 
   374 
       
   375         int lastGmtOffsetValue = -1;
   375         int currentSave = 0;
   376         int currentSave = 0;
   376         boolean usedZone;
   377         boolean usedZone;
   377         for (int zindex = 0; zindex < zone.size(); zindex++) {
   378         for (int zindex = 0; zindex < zone.size(); zindex++) {
   378             zrec = zone.get(zindex);
   379             zrec = zone.get(zindex);
   379             usedZone = false;
   380             usedZone = false;
   380             gmtOffset = zrec.getGmtOffset();
   381             gmtOffset = zrec.getGmtOffset();
   381             int stdOffset = zrec.getDirectSave();
   382             int stdOffset = zrec.getDirectSave();
   382 
   383 
       
   384             if (gmtOffset != lastGmtOffsetValue) {
       
   385                 tz.setRawOffset(gmtOffset, fromTime);
       
   386                 lastGmtOffsetValue = gmtOffset;
       
   387             }
   383             // If this is the last zone record, take the last rule info.
   388             // If this is the last zone record, take the last rule info.
   384             if (!zrec.hasUntil()) {
   389             if (!zrec.hasUntil()) {
   385                 tz.setRawOffset(gmtOffset, fromTime);
       
   386                 if (zrec.hasRuleReference()) {
   390                 if (zrec.hasRuleReference()) {
   387                     tz.setLastRules(zrec.getRuleRef().getLastRules());
   391                     tz.setLastRules(zrec.getRuleRef().getLastRules());
   388                 } else if (stdOffset != 0) {
   392                 } else if (stdOffset != 0) {
   389                     // in case the last rule is all year round DST-only
   393                     // in case the last rule is all year round DST-only
   390                     // (Asia/Amman once announced this rule.)
   394                     // (Asia/Amman once announced this rule.)