aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/util
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1999-05-12 11:01:31 -0700
committerPer Bothner <bothner@gcc.gnu.org>1999-05-12 11:01:31 -0700
commit8bb61fb95337941507285642dca81c418b1e4c3c (patch)
treec62aae060c68a133659186946a3a81cdf3de1365 /libjava/java/util
parent68ca6de40df0e24cf07cd1463325b475f8d10ef8 (diff)
downloadgcc-8bb61fb95337941507285642dca81c418b1e4c3c.zip
gcc-8bb61fb95337941507285642dca81c418b1e4c3c.tar.gz
gcc-8bb61fb95337941507285642dca81c418b1e4c3c.tar.bz2
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
Diffstat (limited to 'libjava/java/util')
-rw-r--r--libjava/java/util/Calendar.java1
-rw-r--r--libjava/java/util/natGregorianCalendar.cc2
2 files changed, 2 insertions, 1 deletions
diff --git a/libjava/java/util/Calendar.java b/libjava/java/util/Calendar.java
index f4806a3..bd022a7 100644
--- a/libjava/java/util/Calendar.java
+++ b/libjava/java/util/Calendar.java
@@ -187,6 +187,7 @@ public abstract class Calendar implements java.io.Serializable, Cloneable
public final void set (int fld, int value)
{
+ if (! areFieldsSet) computeFields();
fields[fld] = value;
isTimeSet = false;
}
diff --git a/libjava/java/util/natGregorianCalendar.cc b/libjava/java/util/natGregorianCalendar.cc
index cfa98bd..5f1374e 100644
--- a/libjava/java/util/natGregorianCalendar.cc
+++ b/libjava/java/util/natGregorianCalendar.cc
@@ -57,7 +57,7 @@ java::util::GregorianCalendar::computeTime ()
t += zone->getRawOffset();
// Adjust for milliseconds.
- time = t * 1000 + elements(fields)[MILLISECOND];
+ time = t * (jlong) 1000 + elements(fields)[MILLISECOND];
isTimeSet = true;
}