提交 464b0ee8 编写于 作者: A aefimov

8037180: [TEST_BUG] test/sun/util/calendar/zi/Zoneinfo.java incorrectly...

8037180: [TEST_BUG] test/sun/util/calendar/zi/Zoneinfo.java incorrectly calculates raw GMT offset change time
Reviewed-by: coffeys, okutsu
上级 c6ba9e51
...@@ -372,6 +372,7 @@ class Zoneinfo { ...@@ -372,6 +372,7 @@ class Zoneinfo {
ZoneRec zrec = zone.get(zone.size()-1); ZoneRec zrec = zone.get(zone.size()-1);
tz.getOffsetIndex(zrec.getGmtOffset()); tz.getOffsetIndex(zrec.getGmtOffset());
int lastGmtOffsetValue = -1;
int currentSave = 0; int currentSave = 0;
boolean usedZone; boolean usedZone;
for (int zindex = 0; zindex < zone.size(); zindex++) { for (int zindex = 0; zindex < zone.size(); zindex++) {
...@@ -380,9 +381,12 @@ class Zoneinfo { ...@@ -380,9 +381,12 @@ class Zoneinfo {
gmtOffset = zrec.getGmtOffset(); gmtOffset = zrec.getGmtOffset();
int stdOffset = zrec.getDirectSave(); 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 this is the last zone record, take the last rule info.
if (!zrec.hasUntil()) { if (!zrec.hasUntil()) {
tz.setRawOffset(gmtOffset, fromTime);
if (zrec.hasRuleReference()) { if (zrec.hasRuleReference()) {
tz.setLastRules(zrec.getRuleRef().getLastRules()); tz.setLastRules(zrec.getRuleRef().getLastRules());
} else if (stdOffset != 0) { } else if (stdOffset != 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册