Commit 8bb61fb9 by Per Bothner

Calendar.java (set): First call computeFields if needed.

x
	* java/util/Calendar.java (set):  First call computeFields if needed.
	* java/util/natGregorianCalendar.cc (computeTime):  Cast 1000 to jlong.

From-SVN: r26910
parent 68ca6de4
...@@ -187,6 +187,7 @@ public abstract class Calendar implements java.io.Serializable, Cloneable ...@@ -187,6 +187,7 @@ public abstract class Calendar implements java.io.Serializable, Cloneable
public final void set (int fld, int value) public final void set (int fld, int value)
{ {
if (! areFieldsSet) computeFields();
fields[fld] = value; fields[fld] = value;
isTimeSet = false; isTimeSet = false;
} }
......
...@@ -57,7 +57,7 @@ java::util::GregorianCalendar::computeTime () ...@@ -57,7 +57,7 @@ java::util::GregorianCalendar::computeTime ()
t += zone->getRawOffset(); t += zone->getRawOffset();
// Adjust for milliseconds. // Adjust for milliseconds.
time = t * 1000 + elements(fields)[MILLISECOND]; time = t * (jlong) 1000 + elements(fields)[MILLISECOND];
isTimeSet = true; isTimeSet = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment