Patch: GregorianCalendar returns bad values from getMinimum().

Mark Wielaard mark@klomp.org
Sun Feb 6 16:56:00 GMT 2005


Hi (CCed Sven and Andrew so they can spot anything I might have missed),

On Fri, 2005-02-04 at 12:14 -0500, Bryce McKinlay wrote:
> David Daney wrote:
> 
> >> Note that these classes are improved an mainly rewritten much in GNU
> >> classpath. It perhaps just be better to merge all needed stuff from
> >> there instead of applying different patches here and there and then
> >> getting headaches while merging again. 
> >
> There are a few changes in Classpath that are not reflected in libgcj, 
> however I wouldn't call it a rewrite. Someone has gone and rather 
> gratuitously reformatted a bunch of code and created a lot of diffs, but 
> there's only a few significant code changes. 

Sven has gone over the Calendar stuff in GNU Classpath in cooperation
with the Kaffe hackers who are a bit quicker merging in changes from GNU
Classpath then libgcj these days. They have some regression tests for
this not yet in Mauve. And they regularly try to run Gump which points
out several more issues.

He of course did post a code indentation cleanup patch separate from the
actual code changes. I have pointed him to this thread and I believe he
did incorporated the fix from David in one of his later fixes of the
code.

If you merge this into libgcj make sure you get all of these changes to
the Calendar and Date classes:

2005-02-05  Sven de Marothy  <sven@physto.se>

        * java/text/SimpleDateFormat.java
        (parse): Tweak handling of 2-year dates
        * java/util/Calendar.java
        (clear): Clear fields to correct value.
        * java/util/GregorianCalendar.java
        (computeTime): Correct handling of time zones.
        Correct field minimum values.

2005-02-02  Sven de Marothy  <sven@physto.se>

        * java/util/Calendar.java
        (set) Invalidate all fields on first call to set().

2005-02-01  Sven de Marothy  <sven@physto.se>

        * java/util/GregorianCalendar.java
        (computeTime): Fixed handling of time zones.

2005-02-01  Sven de Marothy  <sven@physto.se>

        * java/util/Calendar.java
        (clear): Set values to Epoch instead of zero.
        (set): Set isSet to the relevant field pattern instead of just
        the field.
        * java/util/GregorianCalendar.java
        (getBundle): Removed.
        (getDayOfYear): Removed.
        (getFirstDayOfMonth): New private method.
        (nonLeniencyCheck): New private method.
        (computeTime): Correct handling of insufficient data.

2005-01-23  Sven de Marothy <sven@physto.se>

        * java/util/Calendar.java: Invalidate ERA field on setting
        the YEAR.
        * java/util/SimpleTimeZone.java:
        (getDaysInMonth): Reimplemented.
        * java/util/GregorianCalendar.java:
        (getLinearTime): Removed.
        (isLeapYear(int,boolean)): Removed.
        (before(), after()): Removed.
        (computeTime): Reimplemented.

2005-01-21  Sven de Marothy <sven@physto.se>

        * java/util/Calendar.java: Reformatted.
        * java/util/GregorianCalendar.java: Reformatted.
        * java/util/SimpleTimeZon.java: Reformatted.

And note that Andrew John Hughes also made a couple of fixes for
java.text.DataFormat that you might want to incorporate:

2005-02-02  Andrew John Hughes  <gnu_andrew@member.fsf.org>

        * java/text/SimpleDateFormat.java
        Lots of documentation updates.
        (readObject(java.io.ObjectInputStream)): Wraps
        IllegalArgumentException as specified.
        (compileFormat(String)): Uses standardChars
        rather than the local pattern characters.
        Throws IllegalArgumentException rather than
        storing a -1 field.
        (toString()): Extended to include all variables
        in a better format.
        (translateLocalizedPattern(String, String, String)):
        Renamed to better define the use of this method.

2005-01-23  Andrew John Hughes  <gnu_andrew@member.fsf.org>

        * java/text/DateFormat.java:
        Documented pattern character offset constants and
        added new ones.
        (Field): Added new static fields for new pattern chars.
        * java/text/SimpleDateFormat.java:
        (CompiledField): Changed name of FieldSizePair class
        to CompiledField after adding the character as an
        attribute.  Changed fields to private and added
        accessors to give encapsulation.
        (CompiledField.CompiledField(int,int,char)): Extended
        with character field.
        (CompiledField.getField()): New accessor method.
        (CompiledField.getSize()): New acceessor method.
        (CompiledField.getCharacter()): New accessor method.
        (CompiledField.toString()): Added primarily for debugging.
        (standardChars): Now uses extended 24 character sequence.
        (compileFormat(String)): Changed to use CompiledField.
        (formatWithAttribute(java.util.Date, gnu.java.text.FormatBuffer,
        java.text.FieldPosition)): Changed to use CompiledField.
        New handler for RFC 822 timezones added.

2005-01-21  Andrew John Hughes  <gnu_andrew@member.fsf.org>

        * java/text/SimpleDateFormat.java:
        (parse(String, java.text.ParsePosition)):
        Changed 'E' and 'M' cases to use both
        short and long names.  Extended 'z'
        case to also handle 'Z', and deal
        with simple GMT offsets such as +0100.
        (computeOffset(String)): New private method,
        which converts a GMT offset specification,
        such as GMT-0500 to a numeric offset in
        milliseconds.
        * java/util/TimeZone.java:
        (timezones()): Added "CEST", the daylight
        savings time version of "CET", or Central
        European Time.

Plus these from Ito, one of the kaffe hackers:

2005-01-29  Ito Kazumitsu  <kaz@maczuka.gcd.org>

        * java/text/SimpleDateFormat.java:
        (parse): Set the DST offset to 0 when parsing
        GMT offset timezones.

2005-01-25  Ito Kazumitsu  <kaz@maczuka.gcd.org>

        * java/text/SimpleDateFormat.java:
        (parse): Use offset to set ZONE_OFFSET
        rather than the DST_OFFSET, so that
        GMT offset timezones change the right
        one.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20050206/d4f97001/attachment.sig>


More information about the Java-patches mailing list