Hi,

I was debugging the following bug report:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=377
"TimeZone.getOffset() fails for some TZ"
The issue is caused because there is a start rule in the Asia/Amman
timezone that starts at the end of a day. SimpleTimeZone doesn't allow
that. I have a simple "fix" (attached), but I haven't fully tested it
yet, and don't know if there could be other problems with allowing a
rule to start on the last milisecond of a day.

I noticed there is a similar bug report here:
http://bugs.sun.com/view_bug.do?bug_id=6851214
That is marked as "State 11-Closed, Verified, bug".
There is however very little information on how this was fixed.
Does anybody on this list know more?

Thanks,

Mark
diff -r 348fce38de3f src/share/classes/java/util/SimpleTimeZone.java
--- openjdk/jdk/src/share/classes/java/util/SimpleTimeZone.java	Fri Jun 26 19:50:44 2009 +0400
+++ openjdk/jdk/src/share/classes/java/util/SimpleTimeZone.java	Sat Aug 29 22:36:41 2009 +0200
@@ -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);
             }

Reply via email to