6851214: (tz) New Jordan rule creates a failure for SimpleTimeZone parsing post tzdata2009h
authorpeytoia
Mon, 31 Aug 2009 12:55:15 +0900
changeset 3738 837612df050f
parent 3737 83fb4621a129
child 3739 0825ce592b81
6851214: (tz) New Jordan rule creates a failure for SimpleTimeZone parsing post tzdata2009h Reviewed-by: okutsu
jdk/src/share/classes/java/util/SimpleTimeZone.java
jdk/test/java/util/TimeZone/ListTimeZones.java
--- a/jdk/src/share/classes/java/util/SimpleTimeZone.java	Mon Aug 24 19:22:38 2009 +0400
+++ b/jdk/src/share/classes/java/util/SimpleTimeZone.java	Mon Aug 31 12:55:15 2009 +0900
@@ -1372,7 +1372,7 @@
                 throw new IllegalArgumentException(
                         "Illegal start month " + startMonth);
             }
-            if (startTime < 0 || startTime >= millisPerDay) {
+            if (startTime < 0 || startTime > millisPerDay) {
                 throw new IllegalArgumentException(
                         "Illegal start time " + startTime);
             }
@@ -1419,7 +1419,7 @@
                 throw new IllegalArgumentException(
                         "Illegal end month " + endMonth);
             }
-            if (endTime < 0 || endTime >= millisPerDay) {
+            if (endTime < 0 || endTime > millisPerDay) {
                 throw new IllegalArgumentException(
                         "Illegal end time " + endTime);
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/TimeZone/ListTimeZones.java	Mon Aug 31 12:55:15 2009 +0900
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug 6851214
+ * @summary Allow 24:00 as a valid end/start DST time stamp
+ * @run main ListTimeZones
+ */
+
+import java.util.*;
+
+public class ListTimeZones{
+  public static void main(String[] args){
+    Date date = new Date();
+    String TimeZoneIds[] = TimeZone.getAvailableIDs();
+    for(int i = 0; i < TimeZoneIds.length; i++){
+      TimeZone tz = TimeZone.getTimeZone(TimeZoneIds[i]);
+      Calendar calendar = new GregorianCalendar(tz);
+      String calString = calendar.toString();
+    }
+  }
+}