< prev index next >

src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java

Print this page
rev 49854 : 8181157: CLDR Timezone name fallback implementation
Reviewed-by: sherman
   1 /*
   2  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 112         case "CalendarNameProvider":
 113             return (P) getCalendarNameProvider();
 114         case "CalendarProvider":
 115             return (P) getCalendarProvider();
 116         case "JavaTimeDateTimePatternProvider":
 117             return (P) getJavaTimeDateTimePatternProvider();
 118         default:
 119             throw new InternalError("should not come down here");
 120         }
 121     }
 122 
 123     private volatile BreakIteratorProvider breakIteratorProvider;
 124     private volatile CollatorProvider collatorProvider;
 125     private volatile DateFormatProvider dateFormatProvider;
 126     private volatile DateFormatSymbolsProvider dateFormatSymbolsProvider;
 127     private volatile DecimalFormatSymbolsProvider decimalFormatSymbolsProvider;
 128     private volatile NumberFormatProvider numberFormatProvider;
 129 
 130     private volatile CurrencyNameProvider currencyNameProvider;
 131     private volatile LocaleNameProvider localeNameProvider;
 132     private volatile TimeZoneNameProvider timeZoneNameProvider;
 133     protected volatile CalendarDataProvider calendarDataProvider;
 134     private volatile CalendarNameProvider calendarNameProvider;
 135 
 136     private volatile CalendarProvider calendarProvider;
 137     private volatile JavaTimeDateTimePatternProvider javaTimeDateTimePatternProvider;
 138 
 139     /*
 140      * Getter methods for java.text.spi.* providers
 141      */
 142     @Override
 143     public BreakIteratorProvider getBreakIteratorProvider() {
 144         if (breakIteratorProvider == null) {
 145             BreakIteratorProvider provider = AccessController.doPrivileged(
 146                 (PrivilegedAction<BreakIteratorProvider>) () ->
 147                     new BreakIteratorProviderImpl(
 148                         getAdapterType(),
 149                         getLanguageTagSet("FormatData")));
 150 
 151             synchronized (this) {
 152                 if (breakIteratorProvider == null) {


   1 /*
   2  * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 112         case "CalendarNameProvider":
 113             return (P) getCalendarNameProvider();
 114         case "CalendarProvider":
 115             return (P) getCalendarProvider();
 116         case "JavaTimeDateTimePatternProvider":
 117             return (P) getJavaTimeDateTimePatternProvider();
 118         default:
 119             throw new InternalError("should not come down here");
 120         }
 121     }
 122 
 123     private volatile BreakIteratorProvider breakIteratorProvider;
 124     private volatile CollatorProvider collatorProvider;
 125     private volatile DateFormatProvider dateFormatProvider;
 126     private volatile DateFormatSymbolsProvider dateFormatSymbolsProvider;
 127     private volatile DecimalFormatSymbolsProvider decimalFormatSymbolsProvider;
 128     private volatile NumberFormatProvider numberFormatProvider;
 129 
 130     private volatile CurrencyNameProvider currencyNameProvider;
 131     private volatile LocaleNameProvider localeNameProvider;
 132     protected volatile TimeZoneNameProvider timeZoneNameProvider;
 133     protected volatile CalendarDataProvider calendarDataProvider;
 134     private volatile CalendarNameProvider calendarNameProvider;
 135 
 136     private volatile CalendarProvider calendarProvider;
 137     private volatile JavaTimeDateTimePatternProvider javaTimeDateTimePatternProvider;
 138 
 139     /*
 140      * Getter methods for java.text.spi.* providers
 141      */
 142     @Override
 143     public BreakIteratorProvider getBreakIteratorProvider() {
 144         if (breakIteratorProvider == null) {
 145             BreakIteratorProvider provider = AccessController.doPrivileged(
 146                 (PrivilegedAction<BreakIteratorProvider>) () ->
 147                     new BreakIteratorProviderImpl(
 148                         getAdapterType(),
 149                         getLanguageTagSet("FormatData")));
 150 
 151             synchronized (this) {
 152                 if (breakIteratorProvider == null) {


< prev index next >