< prev index next >

src/java.base/share/classes/sun/util/calendar/ZoneInfo.java

Print this page
rev 55814 : imported patch 8212970

*** 271,281 **** } return offset; } // beyond the transitions, delegate to SimpleTimeZone if there ! // is a rule; otherwise, return rawOffset. SimpleTimeZone tz = getLastRule(); if (tz != null) { int rawoffset = tz.getRawOffset(); long msec = date; if (type != UTC_TIME) { --- 271,281 ---- } return offset; } // beyond the transitions, delegate to SimpleTimeZone if there ! // is a rule; otherwise, return the offset of the last transition. SimpleTimeZone tz = getLastRule(); if (tz != null) { int rawoffset = tz.getRawOffset(); long msec = date; if (type != UTC_TIME) {
*** 291,308 **** if (offsets != null) { offsets[0] = rawoffset; offsets[1] = dstoffset; } return rawoffset + dstoffset; ! } ! int offset = getLastRawOffset(); if (offsets != null) { ! offsets[0] = offset; ! offsets[1] = 0; } return offset; } private int getTransitionIndex(long date, int type) { int low = 0; int high = transitions.length - 1; --- 291,313 ---- if (offsets != null) { offsets[0] = rawoffset; 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; } + } private int getTransitionIndex(long date, int type) { int low = 0; int high = transitions.length - 1;
*** 500,511 **** // beyond the transition table SimpleTimeZone tz = getLastRule(); if (tz != null) { return tz.inDaylightTime(date); } - return false; } /** * Returns the amount of time in milliseconds that the clock is advanced * during daylight saving time is in effect in its last daylight saving time rule. --- 505,518 ---- // beyond the transition table SimpleTimeZone tz = getLastRule(); if (tz != null) { return tz.inDaylightTime(date); + } else { + // use the last transition + return (transitions[transitions.length - 1] & DST_MASK) != 0; } } /** * Returns the amount of time in milliseconds that the clock is advanced * during daylight saving time is in effect in its last daylight saving time rule.
< prev index next >