--- old/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java 2015-04-27 18:10:17.598065730 +0200 +++ new/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java 2015-04-27 18:10:17.489067641 +0200 @@ -104,6 +104,10 @@ */ private static final long serialVersionUID = -6946044323557704546L; /** + * The transition epoch-second. + */ + private final long epochSecond; + /** * The local transition date-time at the transition. */ private final LocalDateTime transition; @@ -152,6 +156,7 @@ * @param offsetAfter the offset at and after the transition, not null */ ZoneOffsetTransition(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter) { + this.epochSecond = transition.toEpochSecond(offsetBefore); this.transition = transition; this.offsetBefore = offsetBefore; this.offsetAfter = offsetAfter; @@ -165,6 +170,7 @@ * @param offsetAfter the offset at and after the transition, not null */ ZoneOffsetTransition(long epochSecond, ZoneOffset offsetBefore, ZoneOffset offsetAfter) { + this.epochSecond = epochSecond; this.transition = LocalDateTime.ofEpochSecond(epochSecond, 0, offsetBefore); this.offsetBefore = offsetBefore; this.offsetAfter = offsetAfter; @@ -209,7 +215,7 @@ * @throws IOException if an error occurs */ void writeExternal(DataOutput out) throws IOException { - Ser.writeEpochSec(toEpochSecond(), out); + Ser.writeEpochSec(epochSecond, out); Ser.writeOffset(offsetBefore, out); Ser.writeOffset(offsetAfter, out); } @@ -253,7 +259,7 @@ * @return the transition epoch second */ public long toEpochSecond() { - return transition.toEpochSecond(offsetBefore); + return epochSecond; } //-------------------------------------------------------------------------