changeset 4630:48eafb721da1

7090844: Support a timezone whose offset is changed more than once in the future Reviewed-by: okutsu
author peytoia
date Thu, 15 Sep 2011 15:55:26 +0900
parents d17cd240b384
children 6b1e65e73b80
files make/tools/src/build/tools/javazic/Mappings.java
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/make/tools/src/build/tools/javazic/Mappings.java	Wed Sep 14 03:26:54 2011 -0700
+++ b/make/tools/src/build/tools/javazic/Mappings.java	Thu Sep 15 15:55:26 2011 +0900
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. 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
@@ -26,9 +26,6 @@
 package build.tools.javazic;
 
 import  java.util.ArrayList;
-import  java.util.HashMap;
-import  java.util.HashSet;
-import  java.util.Iterator;
 import  java.util.LinkedList;
 import  java.util.List;
 import  java.util.Map;
@@ -79,8 +76,8 @@
             // If the GMT offset of this Zone will change in some
             // future time, this Zone is added to the exclude list.
             boolean isExcluded = false;
-            if (zone.size() > 1) {
-                ZoneRec zrec = zone.get(zone.size()-2);
+            for (int i = 0; i < zone.size(); i++) {
+                ZoneRec zrec = zone.get(i);
                 if ((zrec.getGmtOffset() != rawOffset)
                     && (zrec.getUntilTime(0) > Time.getCurrentTime())) {
                     if (excludeList == null) {
@@ -88,6 +85,7 @@
                     }
                     excludeList.add(zone.getName());
                     isExcluded = true;
+                    break;
                 }
             }