aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsherman <none@none>2013-10-21 11:16:02 -0700
committersherman <none@none>2013-10-21 11:16:02 -0700
commit63e396f1eca341a5a97aea05217006afc13e02e5 (patch)
tree082c958bba06a203bea670a66290f3b27c6c209e
parentf8eb1b6a8d539d9c33e601976630d77d8a71db0a (diff)
downloadjdk8u_jdk-63e396f1eca341a5a97aea05217006afc13e02e5.tar.gz
8026842: Remove Time-Zone IDs HST/EST/MST
Summary: removed these ids from ZoneId's zid list, supported via short_ids list Reviewed-by: okutsu
-rw-r--r--make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java5
-rw-r--r--src/share/classes/sun/util/calendar/ZoneInfoFile.java15
-rw-r--r--test/java/time/test/java/time/format/TestZoneTextPrinterParser.java6
3 files changed, 22 insertions, 4 deletions
diff --git a/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java b/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java
index be0204eeee..9f1204ca7f 100644
--- a/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java
+++ b/make/tools/src/build/tools/tzdb/TzdbZoneRulesCompiler.java
@@ -618,6 +618,11 @@ public final class TzdbZoneRulesCompiler {
// remove ROC, which is not supported in j.u.tz
builtZones.remove("ROC");
links.remove("ROC");
+ // remove EST, HST and MST. They are supported via
+ // the short-id mapping
+ builtZones.remove("EST");
+ builtZones.remove("HST");
+ builtZones.remove("MST");
}
/**
diff --git a/src/share/classes/sun/util/calendar/ZoneInfoFile.java b/src/share/classes/sun/util/calendar/ZoneInfoFile.java
index 2434bbcbd3..d3ca7e94ee 100644
--- a/src/share/classes/sun/util/calendar/ZoneInfoFile.java
+++ b/src/share/classes/sun/util/calendar/ZoneInfoFile.java
@@ -66,8 +66,17 @@ public final class ZoneInfoFile {
* @return a set of time zone IDs.
*/
public static String[] getZoneIds() {
- String[] ids = Arrays.copyOf(regions, regions.length + oldMappings.length);
+ int len = regions.length + oldMappings.length;
+ if (!USE_OLDMAPPING) {
+ len += 3; // EST/HST/MST not in tzdb.dat
+ }
+ String[] ids = Arrays.copyOf(regions, len);
int i = regions.length;
+ if (!USE_OLDMAPPING) {
+ ids[i++] = "EST";
+ ids[i++] = "HST";
+ ids[i++] = "MST";
+ }
for (int j = 0; j < oldMappings.length; j++) {
ids[i++] = oldMappings[j][0];
}
@@ -264,6 +273,10 @@ public final class ZoneInfoFile {
aliases.put("EST", "America/New_York");
aliases.put("MST", "America/Denver");
aliases.put("HST", "Pacific/Honolulu");
+ } else {
+ zones.put("EST", new ZoneInfo("EST", -18000000));
+ zones.put("MST", new ZoneInfo("MST", -25200000));
+ zones.put("HST", new ZoneInfo("HST", -36000000));
}
}
diff --git a/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java b/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java
index 6e37235619..e16cf7a624 100644
--- a/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java
+++ b/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java
@@ -112,13 +112,13 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser {
}
private static Set<ZoneId> preferred = new HashSet<>(Arrays.asList(new ZoneId[] {
- ZoneId.of("EST"),
+ ZoneId.of("EST", ZoneId.SHORT_IDS),
ZoneId.of("Asia/Taipei"),
ZoneId.of("CET"),
}));
private static Set<ZoneId> preferred_s = new HashSet<>(Arrays.asList(new ZoneId[] {
- ZoneId.of("EST"),
+ ZoneId.of("EST", ZoneId.SHORT_IDS),
ZoneId.of("CET"),
ZoneId.of("Australia/South"),
ZoneId.of("Australia/West"),
@@ -131,7 +131,7 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser {
Object[][] data_preferredZones() {
return new Object[][] {
{"America/New_York", "Eastern Standard Time", none, Locale.ENGLISH, TextStyle.FULL},
- {"EST", "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
+// {"EST", "Eastern Standard Time", preferred, Locale.ENGLISH, TextStyle.FULL},
{"Europe/Paris", "Central European Time", none, Locale.ENGLISH, TextStyle.FULL},
{"CET", "Central European Time", preferred, Locale.ENGLISH, TextStyle.FULL},
{"Asia/Shanghai", "China Standard Time", none, Locale.ENGLISH, TextStyle.FULL},