]> granicus.if.org Git - icu/commitdiff
ICU-8626 Set time zone ID in the OlsonTimeZone constructor, not via setID after creation.
authorYoshito Umaoka <y.umaoka@gmail.com>
Wed, 8 Jun 2011 22:32:24 +0000 (22:32 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Wed, 8 Jun 2011 22:32:24 +0000 (22:32 +0000)
X-SVN-Rev: 30197

icu4j/main/classes/core/src/com/ibm/icu/impl/OlsonTimeZone.java
icu4j/main/classes/core/src/com/ibm/icu/impl/ZoneMeta.java

index b6f319db4e13882c05619f60f35a7f67c97720c1..0e4879ad3d5834cd7212b1637e554a158a25c427 100644 (file)
@@ -444,8 +444,10 @@ public class OlsonTimeZone extends BasicTimeZone {
      * @param top the top-level zoneinfo resource bundle.  This is used
      * to lookup the rule that `res' may refer to, if there is one.
      * @param res the resource bundle of the zone to be constructed
+     * @param id time zone ID
      */
-    public OlsonTimeZone(UResourceBundle top, UResourceBundle res){
+    public OlsonTimeZone(UResourceBundle top, UResourceBundle res, String id){
+        super.setID(id);
         construct(top, res);
     }
 
index b518a60b44f6cebd33cd4ccc7d3bbda0add1515a..288aee6fdc8e7ee0f1efaaf779902016d3e39981 100644 (file)
@@ -501,8 +501,7 @@ public final class ZoneMeta {
                 UResourceBundle top = UResourceBundle.getBundleInstance(
                         ICUResourceBundle.ICU_BASE_NAME, ZONEINFORESNAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
                 UResourceBundle res = openOlsonResource(top, id);
-                z = new OlsonTimeZone(top, res);
-                z.setID(id);
+                z = new OlsonTimeZone(top, res, id);
                 SYSTEM_ZONE_CACHE.put(id, z);
             }catch(Exception ex){
                 return null;