--- old/src/java.base/share/classes/sun/util/calendar/ZoneInfo.java 2019-07-25 11:27:55.000000000 -0700 +++ new/src/java.base/share/classes/sun/util/calendar/ZoneInfo.java 2019-07-25 11:27:55.000000000 -0700 @@ -273,7 +273,7 @@ } // 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 @@ 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 @@ 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; + } } /**