Hi again,
This commit makes Calendar.setTimeZone() simply invalidate the
fields rather than recalculating the entire thing. There seems
to be a general thing of setters invalidate, getters calculate
going on in Sun's implementation. At the moment in Classpath
we have a bit of a mixture, which makes things... interesting :)
Cheers,
Gary
Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.9239.2.4
diff -u -r1.9239.2.4 ChangeLog
--- ChangeLog 13 Apr 2007 09:18:00 -0000 1.9239.2.4
+++ ChangeLog 13 Apr 2007 10:48:15 -0000
@@ -1,3 +1,9 @@
+2007-04-13 Gary Benson <[EMAIL PROTECTED]>
+
+ * java/util/Calendar.java
+ (setTimeZone): Don't recalculate anything, just invalidate
+ the fields.
+
2007-04-13 Gary Benson <[EMAIL PROTECTED]>
* java/util/GregorianCalendar.java
Index: java/util/Calendar.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/Calendar.java,v
retrieving revision 1.52.4.2
diff -u -r1.52.4.2 Calendar.java
--- java/util/Calendar.java 13 Apr 2007 08:12:37 -0000 1.52.4.2
+++ java/util/Calendar.java 13 Apr 2007 10:48:15 -0000
@@ -1088,8 +1088,7 @@
public void setTimeZone(TimeZone zone)
{
this.zone = zone;
- computeTime();
- computeFields();
+ areFieldsSet = false;
}
/**