From 7eb08c5fc41e2c76a8c454c04d78cc30086e29ed Mon Sep 17 00:00:00 2001 From: Eric Scharff Date: Mon, 22 Oct 2007 12:23:56 -0600 Subject: [PATCH] If a Calendar changes values, update the (cached) fields. --- classpath/java/util/Calendar.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classpath/java/util/Calendar.java b/classpath/java/util/Calendar.java index 5989c9451b..c479cc49fc 100644 --- a/classpath/java/util/Calendar.java +++ b/classpath/java/util/Calendar.java @@ -76,6 +76,11 @@ public abstract class Calendar { parseIntoFields(time); } + public void setTime(Date date) { + super.setTime(date); + parseIntoFields(this.time); + } + private static boolean isLeapYear(int year) { return (year%4 == 0) && (year%100 != 0) || (year%400 == 0); }