changeset 21842:81911f748777

8027848: The ZoneInfoFile doesn't honor future GMT offset changes Reviewed-by: sherman, coffeys
author aefimov
date Fri, 15 Nov 2013 15:06:04 +0400
parents 72472170840d
children 766fef71e8bb
files jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java	Thu Nov 21 11:58:51 2013 -0800
+++ b/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java	Fri Nov 15 15:06:04 2013 +0400
@@ -406,6 +406,9 @@
     // LocalDateTime.of(2037, 1, 1, 0, 0, 0).toEpochSecond(ZoneOffset.UTC));
     private static final long LDT2037 = 2114380800L;
 
+    //Current time. Used to determine future GMToffset transitions
+    private static final long CURRT = System.currentTimeMillis()/1000;
+
     /* Get a ZoneInfo instance.
      *
      * @param standardTransitions  the standard transitions, not null
@@ -427,8 +430,10 @@
         boolean willGMTOffsetChange = false;
 
         // rawOffset, pick the last one
-        if (standardTransitions.length > 0)
+        if (standardTransitions.length > 0) {
             rawOffset = standardOffsets[standardOffsets.length - 1] * 1000;
+            willGMTOffsetChange = standardTransitions[standardTransitions.length - 1] > CURRT;
+        }
         else
             rawOffset = standardOffsets[0] * 1000;