8212970: TZ database in "vanguard" format support

Reviewed-by: rriggs, joehw, erikj, scolebourne
This commit is contained in:
Naoto Sato 2019-07-26 08:56:28 -07:00
parent e17feae1e8
commit c1a479ad67
38 changed files with 478 additions and 20110 deletions

View file

@ -273,7 +273,7 @@ public class ZoneInfo extends TimeZone {
}
// beyond the transitions, delegate to SimpleTimeZone if there
// is a rule; otherwise, return rawOffset.
// is a rule; otherwise, return the offset of the last transition.
SimpleTimeZone tz = getLastRule();
if (tz != null) {
int rawoffset = tz.getRawOffset();
@ -293,13 +293,18 @@ public class ZoneInfo extends TimeZone {
offsets[1] = dstoffset;
}
return rawoffset + dstoffset;
} else {
// use the last transition
long val = transitions[transitions.length - 1];
int offset = this.offsets[(int)(val & OFFSET_MASK)] + rawOffsetDiff;
if (offsets != null) {
int dst = (int)((val >>> DST_NSHIFT) & 0xfL);
int save = (dst == 0) ? 0 : this.offsets[dst];
offsets[0] = offset - save;
offsets[1] = save;
}
return offset;
}
int offset = getLastRawOffset();
if (offsets != null) {
offsets[0] = offset;
offsets[1] = 0;
}
return offset;
}
private int getTransitionIndex(long date, int type) {
@ -502,8 +507,10 @@ public class ZoneInfo extends TimeZone {
SimpleTimeZone tz = getLastRule();
if (tz != null) {
return tz.inDaylightTime(date);
}
return false;
} else {
// use the last transition
return (transitions[transitions.length - 1] & DST_MASK) != 0;
}
}
/**