[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] java/text/SimpleDateFormat.java(parse): set time zone o
From: |
Andrew John Hughes |
Subject: |
Re: [cp-patches] java/text/SimpleDateFormat.java(parse): set time zone offset |
Date: |
Tue, 25 Jan 2005 18:59:30 +0000 |
On Tue, 2005-01-25 at 15:14, Ito Kazumitsu wrote:
> Hi,
>
> As reported in
> http://www.kaffe.org/pipermail/kaffe/2005-January/101298.html
>
> the method parse of java/text/SimpleDateFormat.java has a bug
> of failing to set the time zone offset. And I suggetst the
> following patch.
>
> ChangeLog:
>
> 2005-01-25 Ito Kazumitsu <address@hidden>
>
> * java/text/SimpleDateFormat.java
> (parse): Set the time zone offset for "GMT+hh:mm".
>
> ####
> --- java/text/SimpleDateFormat.java.orig Tue Jan 25 00:31:59 2005
> +++ java/text/SimpleDateFormat.java Wed Jan 26 00:00:11 2005
> @@ -840,7 +840,7 @@
> // We need a special case for the timezone, because it
> // uses a different data structure than the other cases.
> is_numeric = false;
> - calendar_field = Calendar.DST_OFFSET;
> + calendar_field = Calendar.ZONE_OFFSET;
> String[][] zoneStrings = formatData.getZoneStrings();
> int zoneCount = zoneStrings.length;
> int index = pos.getIndex();
> @@ -868,8 +868,8 @@
> found_zone = true;
> saw_timezone = true;
> TimeZone tz = TimeZone.getTimeZone (strings[0]);
> - calendar.set (Calendar.ZONE_OFFSET, tz.getRawOffset
> ());
> - offset = tz.getDSTSavings();
> + calendar.set (Calendar.DST_OFFSET,
> tz.getDSTSavings());
> + offset = tz.getRawOffset ();
> pos.setIndex(index + strings[k].length());
> break;
> }
> ####
>
>
> _______________________________________________
> Classpath-patches mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/classpath-patches
Thanks for this. The current Mauve test cases only evaluate values in
the default locale within daylight savings (and thus don't show up here,
as the offset is still being picked up). Can you please commit this?
Thanks,
--
Andrew :-)
Please avoid sending me Microsoft Office (e.g. Word, PowerPoint) attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
No software patents in Europe -- http://nosoftwarepatents.com
"Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn."
-- Richard Stallman
"We've all been part of the biggest beta test the world has ever known --
Windows"
-- Victor Wheatman, Gartner
signature.asc
Description: This is a digitally signed message part