提交 2dacf2e1 编写于 作者: O okutsu

8157792: After Integrating tzdata2016d the...

8157792: After Integrating tzdata2016d the test/sun/util/calendar/zi/TestZoneInfo310.java fails for "Asia/Oral" and "Asia/Qyzylorda" Timezones
Reviewed-by: peytoia
上级 0290bd22
...@@ -22,10 +22,14 @@ ...@@ -22,10 +22,14 @@
*/ */
/* /*
*@test * @test
*@bug 8007572 8008161 * @bug 8007572 8008161 8157792
*@summary Test whether the TimeZone generated from JSR310 tzdb is the same * @summary Test whether the TimeZone generated from JSR310 tzdb is the same
*as the one from the tz data from javazic * as the one from the tz data from javazic
* @build BackEnd Checksum DayOfWeek Gen GenDoc Main Mappings Month
* Rule RuleDay RuleRec Simple TestZoneInfo310 Time Timezone
* TzIDOldMapping Zone ZoneInfoFile ZoneInfoOld ZoneRec Zoneinfo
* @run main TestZoneInfo310
*/ */
import java.io.File; import java.io.File;
...@@ -163,10 +167,6 @@ public class TestZoneInfo310 { ...@@ -163,10 +167,6 @@ public class TestZoneInfo310 {
} }
for (String zid : zids_new) { for (String zid : zids_new) {
if (zid.equals("Asia/Oral") || zid.equals("Asia/Qyzylorda")) {
// JDK-8157792 tracking this issue
continue;
}
ZoneInfoOld zi = toZoneInfoOld(TimeZone.getTimeZone(zid)); ZoneInfoOld zi = toZoneInfoOld(TimeZone.getTimeZone(zid));
ZoneInfoOld ziOLD = (ZoneInfoOld)ZoneInfoOld.getTimeZone(zid); ZoneInfoOld ziOLD = (ZoneInfoOld)ZoneInfoOld.getTimeZone(zid);
if (! zi.equalsTo(ziOLD)) { if (! zi.equalsTo(ziOLD)) {
......
...@@ -373,6 +373,7 @@ class Zoneinfo { ...@@ -373,6 +373,7 @@ class Zoneinfo {
tz.getOffsetIndex(zrec.getGmtOffset()); tz.getOffsetIndex(zrec.getGmtOffset());
int lastGmtOffsetValue = -1; int lastGmtOffsetValue = -1;
ZoneRec prevzrec = null;
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++) {
...@@ -441,6 +442,15 @@ class Zoneinfo { ...@@ -441,6 +442,15 @@ class Zoneinfo {
currentSave); currentSave);
if (zrec.hasUntil()) { if (zrec.hasUntil()) {
if (transition >= zrec.getUntilTime(currentSave)) { if (transition >= zrec.getUntilTime(currentSave)) {
// If the GMT offset changed from the previous one,
// record fromTime as a transition.
if (!fromTimeUsed && prevzrec != null
&& gmtOffset != prevzrec.getGmtOffset()) {
tz.addTransition(fromTime,
tz.getOffsetIndex(gmtOffset+currentSave),
tz.getDstOffsetIndex(currentSave));
fromTimeUsed = true; // for consistency
}
break year_loop; break year_loop;
} }
} }
...@@ -452,8 +462,6 @@ class Zoneinfo { ...@@ -452,8 +462,6 @@ class Zoneinfo {
if (fromTime != minTime) { if (fromTime != minTime) {
int prevsave; int prevsave;
ZoneRec prevzrec = zone.get(zindex - 1);
// See if until time in the previous // See if until time in the previous
// ZoneRec is the same thing as the // ZoneRec is the same thing as the
// local time in the next rule. // local time in the next rule.
...@@ -555,6 +563,7 @@ class Zoneinfo { ...@@ -555,6 +563,7 @@ class Zoneinfo {
fromYear = zrec.getUntilYear(); fromYear = zrec.getUntilYear();
year = zrec.getUntilYear(); year = zrec.getUntilYear();
} }
prevzrec = zrec;
} }
if (tz.getDSTType() == Timezone.UNDEF_DST) { if (tz.getDSTType() == Timezone.UNDEF_DST) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册