--- old/src/java.base/share/classes/sun/util/locale/provider/DateFormatProviderImpl.java 2014-08-22 11:18:34.831015228 -0700 +++ new/src/java.base/share/classes/sun/util/locale/provider/DateFormatProviderImpl.java 2014-08-22 11:18:34.547011032 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -42,11 +42,10 @@ */ public class DateFormatProviderImpl extends DateFormatProvider implements AvailableLanguageTags { private final LocaleProviderAdapter.Type type; - private final Set langtags; + private static Set langtags; - public DateFormatProviderImpl(LocaleProviderAdapter.Type type, Set langtags) { + public DateFormatProviderImpl(LocaleProviderAdapter.Type type) { this.type = type; - this.langtags = langtags; } /** @@ -58,12 +57,12 @@ */ @Override public Locale[] getAvailableLocales() { - return LocaleProviderAdapter.toLocaleArray(langtags); + return LocaleProviderAdapter.toLocaleArray(getLangTags(type)); } @Override public boolean isSupportedLocale(Locale locale) { - return LocaleProviderAdapter.isSupportedLocale(locale, type, langtags); + return LocaleProviderAdapter.isSupportedLocale(locale, type, getLangTags(type)); } /** @@ -164,6 +163,17 @@ @Override public Set getAvailableLanguageTags() { + return getLangTags(type); + } + + /** + * Available language tags for FormatData resources. Shared with other "format" + * provider implementations. + * */ + static Set getLangTags(LocaleProviderAdapter.Type t) { + if (langtags == null) { + langtags = ((JRELocaleProviderAdapter)LocaleProviderAdapter.forType(t)).getLanguageTagSet("FormatData"); + } return langtags; } }