Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2719 diff -u -r1.2719 ChangeLog --- ChangeLog 29 Oct 2004 08:54:34 -0000 1.2719 +++ ChangeLog 29 Oct 2004 15:40:05 -0000 @@ -1,3 +1,8 @@ +2004-10-29 Noa Resare + + * java/util/Calendar.java(set): + Fix for DST related regression. + 2004-10-29 Michael Koch * gnu/java/awt/peer/gtk/GtkComponentPeer.java Index: java/util/Calendar.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/Calendar.java,v retrieving revision 1.30 diff -u -r1.30 Calendar.java --- java/util/Calendar.java 22 Oct 2004 17:15:57 -0000 1.30 +++ java/util/Calendar.java 29 Oct 2004 15:40:06 -0000 @@ -347,6 +347,13 @@ private int minimalDaysInFirstWeek; /** + * Is set to true if DST_OFFSET is explicitly set. In that case + * it's value overrides the value computed from the current + * time and the timezone. + */ + private boolean explicitDSTOffset = false; + + /** * The version of the serialized data on the stream. *
0 or not present
*
JDK 1.1.5 or later.
@@ -650,10 +657,12 @@ case HOUR: isSet[HOUR_OF_DAY] = false; break; + case DST_OFFSET: + explicitDSTOffset = true; } // May have crossed over a DST boundary. - if (field != DST_OFFSET && field != ZONE_OFFSET) + if (!explicitDSTOffset && (field != DST_OFFSET && field != ZONE_OFFSET)) isSet[DST_OFFSET] = false; } @@ -676,7 +685,8 @@ isSet[DAY_OF_WEEK] = false; isSet[DAY_OF_WEEK_IN_MONTH] = false; - isSet[DST_OFFSET] = false; // May have crossed a DST boundary. + if (!explicitDSTOffset) + isSet[DST_OFFSET] = false; // May have crossed a DST boundary. } /**