Calendar.java (set): Invalidate DST_OFFSET field as a DST boundary may have been crossed.
2004-10-08 Bryce McKinlay <mckinlay@redhat.com> * java/util/Calendar.java (set): Invalidate DST_OFFSET field as a DST boundary may have been crossed. * java/util/GregorianCalendar.java (add): Throw IllegalArgumentException on attempt to add to DST_OFFSET or ZONE_OFFSET fields. Update javadoc. From-SVN: r88847
This commit is contained in:
committed by
Bryce McKinlay
parent
711f836923
commit
0ba09d8fc6
@@ -651,6 +651,10 @@ public abstract class Calendar implements Serializable, Cloneable
|
||||
isSet[HOUR_OF_DAY] = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// May have crossed over a DST boundary.
|
||||
if (field != DST_OFFSET && field != ZONE_OFFSET)
|
||||
isSet[DST_OFFSET] = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -671,6 +675,8 @@ public abstract class Calendar implements Serializable, Cloneable
|
||||
isSet[WEEK_OF_MONTH] = false;
|
||||
isSet[DAY_OF_WEEK] = false;
|
||||
isSet[DAY_OF_WEEK_IN_MONTH] = false;
|
||||
|
||||
isSet[DST_OFFSET] = false; // May have crossed a DST boundary.
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user