TimeZone.java: Handle default (one hour) daylight savings.
authorJakub Jelinek <jakub@redhat.com>
Fri, 9 Feb 2007 18:14:46 +0000 (18:14 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Fri, 9 Feb 2007 18:14:46 +0000 (18:14 +0000)
2007-02-09  Jakub Jelinek  <jakub@redhat.com>

        * java/util/TimeZone.java: Handle default (one hour) daylight
        savings.

From-SVN: r121766

libjava/classpath/java/util/TimeZone.java

index 4f25016c577fa11ebc1f6d4daff9d2b9f5f3fb8b..f349b031e95959f11c41467c39811b8d688c8686 100644 (file)
@@ -977,7 +977,14 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
        if (index < idLength)
          index--;
 
-       { // convert the dst string to a millis number
+       if (index == prevIndex && (c == ',' || c == ';'))
+         {
+           // Missing dst offset defaults to one hour ahead of standard
+           // time.  
+           dstOffs = stdOffs + 60 * 60 * 1000;
+         }
+       else
+         { // convert the dst string to a millis number
            String offset = sysTimeZoneId.substring(prevIndex, index);
            prevIndex = index;
 
@@ -991,7 +998,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
 
            // TZ timezone offsets are positive when WEST of the meridian.
            dstOffs = -dstOffs;
-       }
+         }
 
        // Done yet? (Format: std offset dst offset)
        // FIXME: We don't support DST without a rule given. Should we?