--- old/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java 2015-06-04 14:16:19.326605966 -0700 +++ new/src/java.base/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java 2015-06-04 14:16:18.996600534 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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 @@ -30,6 +30,7 @@ import java.util.Set; import java.util.TimeZone; import java.util.spi.TimeZoneNameProvider; +import sun.util.calendar.ZoneInfoFile; /** * Concrete implementation of the @@ -42,6 +43,7 @@ public class TimeZoneNameProviderImpl extends TimeZoneNameProvider { private final LocaleProviderAdapter.Type type; private final Set langtags; + private static final String CLDR_NO_INHERITANCE_MARKER = "\u2205\u2205\u2205"; TimeZoneNameProviderImpl(LocaleProviderAdapter.Type type, Set langtags) { this.type = type; @@ -62,7 +64,7 @@ @Override public boolean isSupportedLocale(Locale locale) { - return LocaleProviderAdapter.isSupportedLocale(locale, type, langtags); + return LocaleProviderAdapter.forType(type).isSupportedProviderLocale(locale, langtags); } /** @@ -121,7 +123,28 @@ private String[] getDisplayNameArray(String id, Locale locale) { Objects.requireNonNull(id); Objects.requireNonNull(locale); - return LocaleProviderAdapter.forType(type).getLocaleResources(locale).getTimeZoneNames(id); + + String[] ret = + LocaleProviderAdapter.forType(type).getLocaleResources(locale).getTimeZoneNames(id); + + if (Objects.nonNull(ret) && type == LocaleProviderAdapter.Type.CLDR) { + // check for CLDR's "no inheritance marker" + for (int index = 0; index < ret.length; index++) { + TimeZone tz = null; + if (CLDR_NO_INHERITANCE_MARKER.equals(ret[index])) { + if (Objects.isNull(tz)) { + tz = TimeZone.getTimeZone(id); + } + int offset = tz.getRawOffset(); + if (index == 3 || index == 4) { // daylight + offset += tz.getDSTSavings(); + } + ret[index] = ZoneInfoFile.toCustomID(offset); + } + } + } + + return ret; } /**