summaryrefslogtreecommitdiff
path: root/java/util/Calendar.java
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2001-07-27 02:06:37 +0000
committerBryce McKinlay <mckinlay@redhat.com>2001-07-27 02:06:37 +0000
commit9528794d3f321a0ee495091ca635087f09f3b3b1 (patch)
treeac1421da11b21c55896194d3ee9d6ac7f9d0de89 /java/util/Calendar.java
parenta034097baba7ac2889ecd267a6b96b33c2098324 (diff)
downloadclasspath-9528794d3f321a0ee495091ca635087f09f3b3b1.tar.gz
* java/util/Calendar.java (set): Never recompute fields here. They
will already be set if someone set time explicitly, and it can cause problems to do so. Don't invalidate AM_PM setting if HOUR is set. * java/util/GregorianCalendar.java (computeTime): Don't ignore an HOUR setting if AM_PM is set. Don't try to ensure the HOUR value is sane. * java/text/SimpleDateFormat.java (defaultCentury): New field. (readObject): Call set2DigitYearStart if appropriate so that defaultCentury is calculated. (SimpleDateFormat): Don't bother clearing calendar here. Call computeCenturyStart(). (set2DigitYearStart): Calculate and set defaultCentury. (format): Don't clone the calendar. Use "calendar" not "theCalendar" everywhere. (parse): Likewise. If the pattern is "y" or "yy" and it found exactly 2 numeric digits, use the 80-20 heuristic to parse the value into a default century based on defaultCenturyStart. (computeCenturyStart): Rewritten. Call set2DigitYearStart().
Diffstat (limited to 'java/util/Calendar.java')
-rw-r--r--java/util/Calendar.java5
1 files changed, 0 insertions, 5 deletions
diff --git a/java/util/Calendar.java b/java/util/Calendar.java
index 17f4c7756..814941125 100644
--- a/java/util/Calendar.java
+++ b/java/util/Calendar.java
@@ -549,8 +549,6 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public final void set(int field, int value)
{
- if (!areFieldsSet)
- computeFields();
isTimeSet = false;
fields[field] = value;
isSet[field] = true;
@@ -573,7 +571,6 @@ public abstract class Calendar implements Serializable, Cloneable
isSet[HOUR] = false;
break;
case HOUR:
- isSet[AM_PM] = false;
isSet[HOUR_OF_DAY] = false;
break;
}
@@ -587,8 +584,6 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public final void set(int year, int month, int date)
{
- if (!areFieldsSet)
- computeFields();
isTimeSet = false;
fields[YEAR] = year;
fields[MONTH] = month;