--- old/test/jdk/java/util/PluggableLocale/BreakIteratorProviderTest.java 2018-10-16 01:12:46.981806439 -0700 +++ new/test/jdk/java/util/PluggableLocale/BreakIteratorProviderTest.java 2018-10-16 01:12:46.563767671 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,27 +20,41 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 8062588 8165804 8210406 + * @summary BreakIteratorProvider tests + * @library providersrc/foobarutils + * providersrc/fooprovider + * @modules java.base/sun.util.locale.provider + * java.base/sun.util.resources + * @build com.foobar.Utils + * com.foo.* + * @run main/othervm -Djava.locale.providers=JRE,SPI BreakIteratorProviderTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; +import java.text.BreakIterator; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.ResourceBundle; +import java.util.Set; + +import com.foo.BreakIteratorProviderImpl; + +import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.ResourceBundleBasedAdapter; public class BreakIteratorProviderTest extends ProviderTest { - com.foo.BreakIteratorProviderImpl bip = new com.foo.BreakIteratorProviderImpl(); + BreakIteratorProviderImpl bip = new BreakIteratorProviderImpl(); List availloc = Arrays.asList(BreakIterator.getAvailableLocales()); List providerloc = Arrays.asList(bip.getAvailableLocales()); List jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales()); List jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getBreakIteratorProvider().getAvailableLocales()); - private static final int CHARACTER_INDEX = 0; - private static final int WORD_INDEX = 1; - private static final int LINE_INDEX = 2; - private static final int SENTENCE_INDEX = 3; - public static void main(String[] s) { new BreakIteratorProviderTest(); } @@ -98,4 +112,4 @@ } } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/CalendarDataProviderTest.java 2018-10-16 01:12:47.948896126 -0700 +++ new/test/jdk/java/util/PluggableLocale/CalendarDataProviderTest.java 2018-10-16 01:12:47.523856709 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, 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 @@ -20,16 +20,22 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 7058207 8000986 8062588 8210406 + * @summary CalendarDataProvider tests + * @library providersrc/foobarutils + * providersrc/barprovider + * @build com.foobar.Utils + * com.bar.* + * @run main/othervm -Djava.locale.providers=JRE,SPI CalendarDataProviderTest */ -import java.text.*; -import java.util.*; -import static java.util.Calendar.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; -import com.bar.CalendarDataProviderImpl; +import java.util.Calendar; +import java.util.Locale; + +import static java.util.Calendar.WEDNESDAY; /** * Test case for CalendarDataProvider. @@ -51,7 +57,6 @@ void test() { Locale kids = new Locale("ja", "JP", "kids"); // test provider's supported locale Calendar kcal = Calendar.getInstance(kids); - Calendar jcal = Calendar.getInstance(Locale.JAPAN); // check the week parameters checkResult("firstDayOfWeek", kcal.getFirstDayOfWeek(), WEDNESDAY); @@ -64,4 +69,4 @@ throw new RuntimeException(s); } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/CalendarNameProviderTest.java 2018-10-16 01:12:48.747970232 -0700 +++ new/test/jdk/java/util/PluggableLocale/CalendarNameProviderTest.java 2018-10-16 01:12:48.324930999 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, 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 @@ -20,17 +20,37 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 8000986 8062588 8210406 + * @summary CalendarNameProvider tests + * @library providersrc/foobarutils + * providersrc/barprovider + * @build com.foobar.Utils + * com.bar.* + * @run main/othervm -Djava.locale.providers=JRE,SPI CalendarNameProviderTest */ -import java.text.*; -import java.util.*; -import static java.util.Calendar.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + import com.bar.CalendarNameProviderImpl; +import static java.util.Calendar.ALL_STYLES; +import static java.util.Calendar.DAY_OF_MONTH; +import static java.util.Calendar.DAY_OF_WEEK; +import static java.util.Calendar.DECEMBER; +import static java.util.Calendar.HOUR_OF_DAY; +import static java.util.Calendar.JANUARY; +import static java.util.Calendar.LONG_STANDALONE; +import static java.util.Calendar.MONTH; +import static java.util.Calendar.SATURDAY; +import static java.util.Calendar.SHORT_STANDALONE; +import static java.util.Calendar.SUNDAY; + /** * Test case for CalendarNameProvider. * @@ -101,4 +121,4 @@ throw new RuntimeException(s); } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/ClasspathTest.java 2018-10-16 01:12:49.558045357 -0700 +++ new/test/jdk/java/util/PluggableLocale/ClasspathTest.java 2018-10-16 01:12:49.126005290 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,13 +20,21 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 6388652 8062588 8210406 + * @summary Checks whether providers can be loaded from classpath. + * @library providersrc/foobarutils + * providersrc/barprovider + * @build com.foobar.Utils + * com.bar.* + * @run main/othervm -Djava.locale.providers=JRE,SPI ClasspathTest */ -import java.text.*; -import java.util.*; -import sun.util.resources.*; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; public class ClasspathTest { @@ -45,4 +53,4 @@ throw new RuntimeException("LSS providers were NOT loaded from the class path."); } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/CollatorProviderTest.java 2018-10-16 01:12:50.359119648 -0700 +++ new/test/jdk/java/util/PluggableLocale/CollatorProviderTest.java 2018-10-16 01:12:49.943081065 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,18 +20,40 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 8062588 8210406 + * @summary CollatorProvider tests + * @library providersrc/foobarutils + * providersrc/fooprovider + * @modules java.base/sun.util.locale.provider + * java.base/sun.util.resources + * @build com.foobar.Utils + * com.foo.* + * @run main/othervm -Djava.locale.providers=JRE,SPI CollatorProviderTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.text.Collator; +import java.text.ParseException; +import java.text.RuleBasedCollator; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Set; + +import com.foo.CollatorProviderImpl; + +import sun.util.locale.provider.AvailableLanguageTags; +import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.ResourceBundleBasedAdapter; public class CollatorProviderTest extends ProviderTest { - com.foo.CollatorProviderImpl cp = new com.foo.CollatorProviderImpl(); + CollatorProviderImpl cp = new CollatorProviderImpl(); List availloc = Arrays.asList(Collator.getAvailableLocales()); List providerloc = Arrays.asList(cp.getAvailableLocales()); List jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales()); @@ -94,4 +116,4 @@ checkValidity(target, jresResult, providersResult, result, jreSupportsLocale); } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/CurrencyNameProviderTest.java 2018-10-16 01:12:51.156193568 -0700 +++ new/test/jdk/java/util/PluggableLocale/CurrencyNameProviderTest.java 2018-10-16 01:12:50.722153315 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,14 +20,36 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 7199750 8000997 8062588 8210406 + * @summary CurrencyNameProvider tests + * @library providersrc/foobarutils + * providersrc/barprovider + * @modules java.base/sun.util.locale.provider + * java.base/sun.util.resources + * @build com.foobar.Utils + * com.bar.* + * @run main/othervm -Djava.locale.providers=JRE,SPI CurrencyNameProviderTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Currency; +import java.util.List; +import java.util.Locale; +import java.util.MissingResourceException; + +import com.bar.CurrencyNameProviderImpl; +import com.bar.CurrencyNameProviderImpl2; + +import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.ResourceBundleBasedAdapter; +import sun.util.resources.OpenListResourceBundle; public class CurrencyNameProviderTest extends ProviderTest { @@ -47,8 +69,8 @@ } void test1() { - com.bar.CurrencyNameProviderImpl cnp = new com.bar.CurrencyNameProviderImpl(); - com.bar.CurrencyNameProviderImpl2 cnp2 = new com.bar.CurrencyNameProviderImpl2(); + CurrencyNameProviderImpl cnp = new CurrencyNameProviderImpl(); + CurrencyNameProviderImpl2 cnp2 = new CurrencyNameProviderImpl2(); Locale[] availloc = Locale.getAvailableLocales(); Locale[] testloc = availloc.clone(); List jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getCurrencyNameProvider().getAvailableLocales()); @@ -163,4 +185,4 @@ Locale.setDefault(defloc); } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/DateFormatProviderTest.java 2018-10-16 01:12:51.984270363 -0700 +++ new/test/jdk/java/util/PluggableLocale/DateFormatProviderTest.java 2018-10-16 01:12:51.548229925 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,18 +20,41 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 7003643 8062588 8210406 + * @summary DateFormatProvider tests + * @library providersrc/foobarutils + * providersrc/fooprovider + * @modules java.base/sun.util.locale.provider + * java.base/sun.util.resources + * @build com.foobar.Utils + * com.foo.* + * @run main/othervm -Djava.locale.providers=JRE,SPI DateFormatProviderTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.text.DateFormat; +import java.text.Format; +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Calendar; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Set; + +import com.foo.DateFormatProviderImpl; + +import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.ResourceBundleBasedAdapter; public class DateFormatProviderTest extends ProviderTest { - com.foo.DateFormatProviderImpl dfp = new com.foo.DateFormatProviderImpl(); + DateFormatProviderImpl dfp = new DateFormatProviderImpl(); List availloc = Arrays.asList(DateFormat.getAvailableLocales()); List providerloc = Arrays.asList(dfp.getAvailableLocales()); List jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales()); @@ -181,4 +204,4 @@ } } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/DateFormatSymbolsProviderTest.java 2018-10-16 01:12:52.807346694 -0700 +++ new/test/jdk/java/util/PluggableLocale/DateFormatSymbolsProviderTest.java 2018-10-16 01:12:52.364305607 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,18 +20,37 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 7200341 8062588 8210406 + * @summary DateFormatSymbolsProvider tests + * @library providersrc/foobarutils + * providersrc/fooprovider + * @modules java.base/sun.util.locale.provider + * java.base/sun.util.resources + * @build com.foobar.Utils + * com.foo.* + * @run main/othervm -Djava.locale.providers=JRE,SPI DateFormatSymbolsProviderTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.text.DateFormatSymbols; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Set; + +import com.foo.DateFormatSymbolsProviderImpl; + +import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.ResourceBundleBasedAdapter; public class DateFormatSymbolsProviderTest extends ProviderTest { - com.foo.DateFormatSymbolsProviderImpl dfsp = new com.foo.DateFormatSymbolsProviderImpl(); + DateFormatSymbolsProviderImpl dfsp = new DateFormatSymbolsProviderImpl(); List availloc = Arrays.asList(DateFormatSymbols.getAvailableLocales()); List providerloc = Arrays.asList(dfsp.getAvailableLocales()); List jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales()); @@ -137,4 +156,4 @@ } } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/DecimalFormatSymbolsProviderTest.java 2018-10-16 01:12:53.604420614 -0700 +++ new/test/jdk/java/util/PluggableLocale/DecimalFormatSymbolsProviderTest.java 2018-10-16 01:12:53.189382124 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,18 +20,33 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 8062588 8210406 + * @summary DecimalFormatSymbolsProvider tests + * @library providersrc/foobarutils + * providersrc/fooprovider + * @modules java.base/sun.util.locale.provider + * @build com.foobar.Utils + * com.foo.* + * @run main/othervm -Djava.locale.providers=JRE,SPI DecimalFormatSymbolsProviderTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.text.DecimalFormatSymbols; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; + +import com.foo.DecimalFormatSymbolsProviderImpl; + +import sun.util.locale.provider.LocaleProviderAdapter; public class DecimalFormatSymbolsProviderTest extends ProviderTest { - com.foo.DecimalFormatSymbolsProviderImpl dfsp = new com.foo.DecimalFormatSymbolsProviderImpl(); + DecimalFormatSymbolsProviderImpl dfsp = new DecimalFormatSymbolsProviderImpl(); List availloc = Arrays.asList(DecimalFormatSymbols.getAvailableLocales()); List providerloc = Arrays.asList(dfsp.getAvailableLocales()); List jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales()); @@ -92,4 +107,4 @@ } } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/GenericTest.java 2018-10-16 01:12:54.397494163 -0700 +++ new/test/jdk/java/util/PluggableLocale/GenericTest.java 2018-10-16 01:12:53.964454003 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,30 +20,58 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 8062588 8210406 + * @summary Generic tests for the pluggable locales feature + * @library providersrc/foobarutils + * providersrc/barprovider + * providersrc/fooprovider + * @modules java.base/sun.util.locale.provider + * @build com.foobar.Utils + * com.bar.* + * com.foo.* + * @run main/othervm -Djava.locale.providers=JRE,SPI GenericTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Locale; +import java.util.Set; + +import com.bar.CalendarDataProviderImpl; +import com.bar.CalendarNameProviderImpl; +import com.bar.CurrencyNameProviderImpl; +import com.bar.CurrencyNameProviderImpl2; +import com.bar.GenericTimeZoneNameProviderImpl; +import com.bar.LocaleNameProviderImpl; +import com.bar.TimeZoneNameProviderImpl; +import com.foo.BreakIteratorProviderImpl; +import com.foo.CollatorProviderImpl; +import com.foo.DateFormatProviderImpl; +import com.foo.DateFormatSymbolsProviderImpl; +import com.foo.DecimalFormatSymbolsProviderImpl; +import com.foo.NumberFormatProviderImpl; + +import sun.util.locale.provider.LocaleProviderAdapter; public class GenericTest { // test providers - com.foo.BreakIteratorProviderImpl breakIP = new com.foo.BreakIteratorProviderImpl(); - com.foo.CollatorProviderImpl collatorP = new com.foo.CollatorProviderImpl(); - com.foo.DateFormatProviderImpl dateFP = new com.foo.DateFormatProviderImpl(); - com.foo.DateFormatSymbolsProviderImpl dateFSP = new com.foo.DateFormatSymbolsProviderImpl(); - com.foo.DecimalFormatSymbolsProviderImpl decimalFSP = new com.foo.DecimalFormatSymbolsProviderImpl(); - com.foo.NumberFormatProviderImpl numberFP = new com.foo.NumberFormatProviderImpl(); - com.bar.CurrencyNameProviderImpl currencyNP = new com.bar.CurrencyNameProviderImpl(); - com.bar.CurrencyNameProviderImpl2 currencyNP2 = new com.bar.CurrencyNameProviderImpl2(); - com.bar.LocaleNameProviderImpl localeNP = new com.bar.LocaleNameProviderImpl(); - com.bar.TimeZoneNameProviderImpl tzNP = new com.bar.TimeZoneNameProviderImpl(); - com.bar.GenericTimeZoneNameProviderImpl tzGenNP = new com.bar.GenericTimeZoneNameProviderImpl(); - com.bar.CalendarDataProviderImpl calDataP = new com.bar.CalendarDataProviderImpl(); - com.bar.CalendarNameProviderImpl calNameP = new com.bar.CalendarNameProviderImpl(); + BreakIteratorProviderImpl breakIP = new BreakIteratorProviderImpl(); + CollatorProviderImpl collatorP = new CollatorProviderImpl(); + DateFormatProviderImpl dateFP = new DateFormatProviderImpl(); + DateFormatSymbolsProviderImpl dateFSP = new DateFormatSymbolsProviderImpl(); + DecimalFormatSymbolsProviderImpl decimalFSP = new DecimalFormatSymbolsProviderImpl(); + NumberFormatProviderImpl numberFP = new NumberFormatProviderImpl(); + CurrencyNameProviderImpl currencyNP = new CurrencyNameProviderImpl(); + CurrencyNameProviderImpl2 currencyNP2 = new CurrencyNameProviderImpl2(); + LocaleNameProviderImpl localeNP = new LocaleNameProviderImpl(); + TimeZoneNameProviderImpl tzNP = new TimeZoneNameProviderImpl(); + GenericTimeZoneNameProviderImpl tzGenNP = new GenericTimeZoneNameProviderImpl(); + CalendarDataProviderImpl calDataP = new CalendarDataProviderImpl(); + CalendarNameProviderImpl calNameP = new CalendarNameProviderImpl(); public static void main(String[] s) { new GenericTest(); @@ -108,4 +136,4 @@ s2.addAll(s1); return s2.toString(); } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/LocaleNameProviderTest.java 2018-10-16 01:12:55.174566228 -0700 +++ new/test/jdk/java/util/PluggableLocale/LocaleNameProviderTest.java 2018-10-16 01:12:54.755527367 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,14 +20,30 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 8000273 8062588 8210406 + * @summary LocaleNameProvider tests + * @library providersrc/foobarutils + * providersrc/barprovider + * @modules java.base/sun.util.locale.provider + * java.base/sun.util.resources + * @build com.foobar.Utils + * com.bar.* + * @run main/othervm -Djava.locale.providers=JRE,SPI LocaleNameProviderTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.MissingResourceException; + +import com.bar.LocaleNameProviderImpl; + +import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.ResourceBundleBasedAdapter; +import sun.util.resources.OpenListResourceBundle; public class LocaleNameProviderTest extends ProviderTest { @@ -41,7 +57,7 @@ } void checkAvailLocValidityTest() { - com.bar.LocaleNameProviderImpl lnp = new com.bar.LocaleNameProviderImpl(); + LocaleNameProviderImpl lnp = new LocaleNameProviderImpl(); Locale[] availloc = Locale.getAvailableLocales(); Locale[] testloc = availloc.clone(); List jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getLocaleNameProvider().getAvailableLocales()); @@ -121,10 +137,10 @@ if (YY_suffix.getVariant().equals(retVrnt)) { System.out.println(message); return; -} + } message = "variantFallbackTest() failed. Returned variant: "+retVrnt; } throw new RuntimeException(message); } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/NumberFormatProviderTest.java 2018-10-16 01:12:55.933636623 -0700 +++ new/test/jdk/java/util/PluggableLocale/NumberFormatProviderTest.java 2018-10-16 01:12:55.520598319 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,20 +20,38 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 7003643 8062588 8210406 + * @summary NumberFormatProvider tests + * @library providersrc/foobarutils + * providersrc/fooprovider + * @modules java.base/sun.util.locale.provider + * @build com.foobar.Utils + * com.foo.* + * @run main/othervm -Djava.locale.providers=JRE,SPI NumberFormatProviderTest */ -import java.text.*; -import java.util.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.MessageFormat; +import java.text.NumberFormat; +import java.util.Arrays; +import java.util.Currency; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; import com.foo.FooNumberFormat; +import com.foo.NumberFormatProviderImpl; + +import sun.util.locale.provider.LocaleProviderAdapter; public class NumberFormatProviderTest extends ProviderTest { - com.foo.NumberFormatProviderImpl nfp = new com.foo.NumberFormatProviderImpl(); + NumberFormatProviderImpl nfp = new NumberFormatProviderImpl(); List availloc = Arrays.asList(NumberFormat.getAvailableLocales()); List providerloc = Arrays.asList(nfp.getAvailableLocales()); List jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales()); @@ -201,4 +219,4 @@ } } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/PermissionTest.java 2018-10-16 01:12:56.735711007 -0700 +++ new/test/jdk/java/util/PluggableLocale/PermissionTest.java 2018-10-16 01:12:56.312671775 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, 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 @@ -20,25 +20,59 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 8075545 8210406 + * @summary Check whether RuntimePermission("localeServiceProvider") is + * handled correctly. + * @library providersrc/foobarutils + * providersrc/barprovider + * providersrc/fooprovider + * @build com.foobar.Utils + * com.bar.* + * com.foo.* + * @run main/othervm PermissionTest + * @run main/othervm/fail/java.security.policy=dummy.policy + * -Djava.security.manager + * -Djava.locale.providers=JRE,SPI + * PermissionTest + * @run main/othervm/java.security.policy=localeServiceProvider.policy + * -Djava.security.manager + * -Djava.locale.providers=JRE,SPI + * PermissionTest */ + +import com.bar.CalendarDataProviderImpl; +import com.bar.CalendarNameProviderImpl; +import com.bar.CurrencyNameProviderImpl; +import com.bar.CurrencyNameProviderImpl2; +import com.bar.GenericTimeZoneNameProviderImpl; +import com.bar.LocaleNameProviderImpl; +import com.bar.TimeZoneNameProviderImpl; +import com.foo.BreakIteratorProviderImpl; +import com.foo.CollatorProviderImpl; +import com.foo.DateFormatProviderImpl; +import com.foo.DateFormatSymbolsProviderImpl; +import com.foo.DecimalFormatSymbolsProviderImpl; +import com.foo.NumberFormatProviderImpl; + public class PermissionTest{ // Make sure provider impls can be instantiated under a security manager.ZZ - com.foo.BreakIteratorProviderImpl breakIP = new com.foo.BreakIteratorProviderImpl(); - com.foo.CollatorProviderImpl collatorP = new com.foo.CollatorProviderImpl(); - com.foo.DateFormatProviderImpl dateFP = new com.foo.DateFormatProviderImpl(); - com.foo.DateFormatSymbolsProviderImpl dateFSP = new com.foo.DateFormatSymbolsProviderImpl(); - com.foo.DecimalFormatSymbolsProviderImpl decimalFSP = new com.foo.DecimalFormatSymbolsProviderImpl(); - com.foo.NumberFormatProviderImpl numberFP = new com.foo.NumberFormatProviderImpl(); - com.bar.CurrencyNameProviderImpl currencyNP = new com.bar.CurrencyNameProviderImpl(); - com.bar.CurrencyNameProviderImpl2 currencyNP2 = new com.bar.CurrencyNameProviderImpl2(); - com.bar.LocaleNameProviderImpl localeNP = new com.bar.LocaleNameProviderImpl(); - com.bar.TimeZoneNameProviderImpl tzNP = new com.bar.TimeZoneNameProviderImpl(); - com.bar.GenericTimeZoneNameProviderImpl tzGenNP = new com.bar.GenericTimeZoneNameProviderImpl(); - com.bar.CalendarDataProviderImpl calDataP = new com.bar.CalendarDataProviderImpl(); - com.bar.CalendarNameProviderImpl calNameP = new com.bar.CalendarNameProviderImpl(); + BreakIteratorProviderImpl breakIP = new BreakIteratorProviderImpl(); + CollatorProviderImpl collatorP = new CollatorProviderImpl(); + DateFormatProviderImpl dateFP = new DateFormatProviderImpl(); + DateFormatSymbolsProviderImpl dateFSP = new DateFormatSymbolsProviderImpl(); + DecimalFormatSymbolsProviderImpl decimalFSP = new DecimalFormatSymbolsProviderImpl(); + NumberFormatProviderImpl numberFP = new NumberFormatProviderImpl(); + CurrencyNameProviderImpl currencyNP = new CurrencyNameProviderImpl(); + CurrencyNameProviderImpl2 currencyNP2 = new CurrencyNameProviderImpl2(); + LocaleNameProviderImpl localeNP = new LocaleNameProviderImpl(); + TimeZoneNameProviderImpl tzNP = new TimeZoneNameProviderImpl(); + GenericTimeZoneNameProviderImpl tzGenNP = new GenericTimeZoneNameProviderImpl(); + CalendarDataProviderImpl calDataP = new CalendarDataProviderImpl(); + CalendarNameProviderImpl calNameP = new CalendarNameProviderImpl(); public static void main(String[] s) { new PermissionTest(); --- old/test/jdk/java/util/PluggableLocale/TimeZoneNameProviderTest.java 2018-10-16 01:12:57.538785484 -0700 +++ new/test/jdk/java/util/PluggableLocale/TimeZoneNameProviderTest.java 2018-10-16 01:12:57.121746808 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, 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 @@ -20,19 +20,41 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /* - * + * @test + * @bug 4052440 8003267 8062588 8210406 + * @summary TimeZoneNameProvider tests + * @library providersrc/foobarutils + * providersrc/barprovider + * @modules java.base/sun.util.locale.provider + * java.base/sun.util.resources + * @build com.foobar.Utils + * com.bar.* + * @run main/othervm -Djava.locale.providers=JRE,SPI TimeZoneNameProviderTest */ -import java.text.*; +import java.text.DateFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.time.format.TextStyle; -import java.util.*; -import sun.util.locale.provider.*; -import sun.util.resources.*; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.TimeZone; + +import com.bar.TimeZoneNameProviderImpl; + +import sun.util.locale.provider.LocaleProviderAdapter; +import sun.util.locale.provider.ResourceBundleBasedAdapter; +import sun.util.resources.OpenListResourceBundle; public class TimeZoneNameProviderTest extends ProviderTest { - com.bar.TimeZoneNameProviderImpl tznp = new com.bar.TimeZoneNameProviderImpl(); + TimeZoneNameProviderImpl tznp = new TimeZoneNameProviderImpl(); public static void main(String[] s) { new TimeZoneNameProviderTest(); @@ -248,4 +270,4 @@ throw new RuntimeException("Generic name fallback failed. got: "+generic); } } -} +} \ No newline at end of file --- old/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.CalendarDataProvider 2018-10-16 01:12:59.198939445 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.util.spi.CalendarDataProvider -# implementation class -# -com.bar.CalendarDataProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.CalendarDataProvider 2018-10-16 01:12:58.709894091 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.util.spi.CalendarDataProvider +# implementation class +# +com.bar.CalendarDataProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.CalendarNameProvider 2018-10-16 01:12:59.850999916 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.util.spi.CalendarNameProvider -# implementation class -# -com.bar.CalendarNameProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.CalendarNameProvider 2018-10-16 01:12:59.393957530 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.util.spi.CalendarNameProvider +# implementation class +# +com.bar.CalendarNameProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.CurrencyNameProvider 2018-10-16 01:13:00.560065674 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,8 +0,0 @@ -# -# -# -# fully-qualified name of the java.util.spi.LocaleNameProvider -# implementation class -# -com.bar.CurrencyNameProviderImpl -com.bar.CurrencyNameProviderImpl2 --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.CurrencyNameProvider 2018-10-16 01:13:00.090022083 -0700 @@ -0,0 +1,8 @@ +# +# +# +# fully-qualified name of the java.util.spi.LocaleNameProvider +# implementation class +# +com.bar.CurrencyNameProviderImpl +com.bar.CurrencyNameProviderImpl2 --- old/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.LocaleNameProvider 2018-10-16 01:13:01.223127166 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.util.spi.LocaleNameProvider -# implementation class -# -com.bar.LocaleNameProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.LocaleNameProvider 2018-10-16 01:13:00.755083760 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.util.spi.LocaleNameProvider +# implementation class +# +com.bar.LocaleNameProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider 2018-10-16 01:13:01.911190976 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,8 +0,0 @@ -# -# -# -# fully-qualified name of the java.util.spi.TimeZoneNameProvider -# implementation class -# -com.bar.TimeZoneNameProviderImpl -com.bar.GenericTimeZoneNameProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/META-INF/services/java.util.spi.TimeZoneNameProvider 2018-10-16 01:13:01.437147014 -0700 @@ -0,0 +1,8 @@ +# +# +# +# fully-qualified name of the java.util.spi.TimeZoneNameProvider +# implementation class +# +com.bar.TimeZoneNameProviderImpl +com.bar.GenericTimeZoneNameProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/CalendarDataProviderImpl.java 2018-10-16 01:13:02.590253952 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2012, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.bar; - -import com.foobar.Utils; -import java.util.Arrays; -import static java.util.Calendar.*; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.spi.CalendarDataProvider; - -public class CalendarDataProviderImpl extends CalendarDataProvider { - static final char FULLWIDTH_ZERO = '\uff10'; - static final Locale[] avail = { - new Locale("ja", "JP", "kids"), - }; - - @Override - public int getFirstDayOfWeek(Locale locale) { - return WEDNESDAY; - } - - @Override - public int getMinimalDaysInFirstWeek(Locale locale) { - return 7; - } - - @Override - public Locale[] getAvailableLocales() { - return avail.clone(); - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/CalendarDataProviderImpl.java 2018-10-16 01:13:02.116209990 -0700 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2012, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.bar; + +import com.foobar.Utils; +import java.util.Arrays; +import static java.util.Calendar.*; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.spi.CalendarDataProvider; + +public class CalendarDataProviderImpl extends CalendarDataProvider { + static final char FULLWIDTH_ZERO = '\uff10'; + static final Locale[] avail = { + new Locale("ja", "JP", "kids"), + }; + + @Override + public int getFirstDayOfWeek(Locale locale) { + return WEDNESDAY; + } + + @Override + public int getMinimalDaysInFirstWeek(Locale locale) { + return 7; + } + + @Override + public Locale[] getAvailableLocales() { + return avail.clone(); + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/CalendarNameProviderImpl.java 2018-10-16 01:13:03.290318875 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2012, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.bar; - -import com.foobar.Utils; -import java.util.Arrays; -import static java.util.Calendar.*; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.spi.CalendarNameProvider; - -public class CalendarNameProviderImpl extends CalendarNameProvider { - static final char FULLWIDTH_ZERO = '\uff10'; - static final Locale[] avail = { - new Locale("ja", "JP", "kids"), - }; - - @Override - public String getDisplayName(String calendarType, int field, int value, int style, Locale locale) { - if (calendarType == null || locale == null) { - throw new NullPointerException(); - } - if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { - throw new IllegalArgumentException("locale is not one of available locales: "+ locale); - } - if (field != MONTH) { - return null; - } - return toMonthName(value + 1, style); - } - - @Override - public Map getDisplayNames(String calendarType, int field, int style, Locale locale) { - if (calendarType == null || locale == null) { - throw new NullPointerException(); - } - if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { - throw new IllegalArgumentException("locale is not one of available locales: " + locale); - } - if (field != MONTH) { - return null; - } - Map map = new HashMap<>(); - if (style == LONG_STANDALONE) { - style = LONG; - } else if (style == SHORT_STANDALONE) { - style = SHORT; - } - for (int month = JANUARY; month <= DECEMBER; month++) { - if (style == ALL_STYLES || style == LONG) { - map.put(toMonthName(month + 1, LONG), month); - } - if (style == ALL_STYLES || style == SHORT) { - map.put(toMonthName(month + 1, SHORT), month); - } - } - return map; - } - - @Override - public Locale[] getAvailableLocales() { - return avail.clone(); - } - - // month is 1-based. - public static String toMonthName(int month, int style) { - StringBuilder sb = new StringBuilder(); - if (month >= 10) { - sb.append((char)(FULLWIDTH_ZERO + 1)); - sb.appendCodePoint((char)(FULLWIDTH_ZERO + (month % 10))); - } else { - sb.appendCodePoint((char)(FULLWIDTH_ZERO + month)); - } - if (style == SHORT || style == SHORT_STANDALONE) { - return sb.toString(); // full-width digit(s) - } - sb.append("\u304c\u3064"); // + "gatsu" in Hiragana - return sb.toString(); - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/CalendarNameProviderImpl.java 2018-10-16 01:13:02.807274078 -0700 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2012, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.bar; + +import com.foobar.Utils; +import java.util.Arrays; +import static java.util.Calendar.*; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.spi.CalendarNameProvider; + +public class CalendarNameProviderImpl extends CalendarNameProvider { + static final char FULLWIDTH_ZERO = '\uff10'; + static final Locale[] avail = { + new Locale("ja", "JP", "kids"), + }; + + @Override + public String getDisplayName(String calendarType, int field, int value, int style, Locale locale) { + if (calendarType == null || locale == null) { + throw new NullPointerException(); + } + if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { + throw new IllegalArgumentException("locale is not one of available locales: "+ locale); + } + if (field != MONTH) { + return null; + } + return toMonthName(value + 1, style); + } + + @Override + public Map getDisplayNames(String calendarType, int field, int style, Locale locale) { + if (calendarType == null || locale == null) { + throw new NullPointerException(); + } + if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { + throw new IllegalArgumentException("locale is not one of available locales: " + locale); + } + if (field != MONTH) { + return null; + } + Map map = new HashMap<>(); + if (style == LONG_STANDALONE) { + style = LONG; + } else if (style == SHORT_STANDALONE) { + style = SHORT; + } + for (int month = JANUARY; month <= DECEMBER; month++) { + if (style == ALL_STYLES || style == LONG) { + map.put(toMonthName(month + 1, LONG), month); + } + if (style == ALL_STYLES || style == SHORT) { + map.put(toMonthName(month + 1, SHORT), month); + } + } + return map; + } + + @Override + public Locale[] getAvailableLocales() { + return avail.clone(); + } + + // month is 1-based. + public static String toMonthName(int month, int style) { + StringBuilder sb = new StringBuilder(); + if (month >= 10) { + sb.append((char)(FULLWIDTH_ZERO + 1)); + sb.appendCodePoint((char)(FULLWIDTH_ZERO + (month % 10))); + } else { + sb.appendCodePoint((char)(FULLWIDTH_ZERO + month)); + } + if (style == SHORT || style == SHORT_STANDALONE) { + return sb.toString(); // full-width digit(s) + } + sb.append("\u304c\u3064"); // + "gatsu" in Hiragana + return sb.toString(); + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/CurrencyNameProviderImpl.java 2018-10-16 01:13:03.984383242 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2007, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.bar; - -import java.util.*; -import java.util.spi.*; - -import com.foobar.Utils; - -public class CurrencyNameProviderImpl extends CurrencyNameProvider { - static Locale[] avail = {new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - Locale.JAPAN, - new Locale("xx")}; - - public Locale[] getAvailableLocales() { - return avail; - } - - public String getSymbol(String c, Locale locale) { - if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - if (c.equals("JPY")) { - if (Utils.supportsLocale(avail[0], locale)) { - return "\u5186\u3084\u3002"; - } else if (Utils.supportsLocale(avail[1], locale)) { - return "\u5186\u3069\u3059\u3002"; - } else if (Utils.supportsLocale(avail[2], locale)) { - return "\u5186\u3067\u3059\u3002"; - } else if (Utils.supportsLocale(avail[3], locale)) { - return "\u5186\u3070\u3064\u3070\u3064\u3002"; - } - } - return null; - } - - @Override - public String getDisplayName(String c, Locale locale) { - if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - if (c.equals("JPY")) { - if (Utils.supportsLocale(avail[0], locale)) { - return "\u65e5\u672c\u5186\u3084\u3002"; - } else if (Utils.supportsLocale(avail[1], locale)) { - return "\u65e5\u672c\u5186\u3069\u3059\u3002"; - } else if (Utils.supportsLocale(avail[2], locale)) { - return "\u65e5\u672c\u5186\u3067\u3059\u3002"; - } else if (Utils.supportsLocale(avail[3], locale)) { - return "\u65e5\u672c\u5186\u3070\u3064\u3070\u3064\u3002"; - } - } - return null; - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/CurrencyNameProviderImpl.java 2018-10-16 01:13:03.504338723 -0700 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2007, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.bar; + +import java.util.*; +import java.util.spi.*; + +import com.foobar.Utils; + +public class CurrencyNameProviderImpl extends CurrencyNameProvider { + static Locale[] avail = {new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + Locale.JAPAN, + new Locale("xx")}; + + public Locale[] getAvailableLocales() { + return avail; + } + + public String getSymbol(String c, Locale locale) { + if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + if (c.equals("JPY")) { + if (Utils.supportsLocale(avail[0], locale)) { + return "\u5186\u3084\u3002"; + } else if (Utils.supportsLocale(avail[1], locale)) { + return "\u5186\u3069\u3059\u3002"; + } else if (Utils.supportsLocale(avail[2], locale)) { + return "\u5186\u3067\u3059\u3002"; + } else if (Utils.supportsLocale(avail[3], locale)) { + return "\u5186\u3070\u3064\u3070\u3064\u3002"; + } + } + return null; + } + + @Override + public String getDisplayName(String c, Locale locale) { + if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + if (c.equals("JPY")) { + if (Utils.supportsLocale(avail[0], locale)) { + return "\u65e5\u672c\u5186\u3084\u3002"; + } else if (Utils.supportsLocale(avail[1], locale)) { + return "\u65e5\u672c\u5186\u3069\u3059\u3002"; + } else if (Utils.supportsLocale(avail[2], locale)) { + return "\u65e5\u672c\u5186\u3067\u3059\u3002"; + } else if (Utils.supportsLocale(avail[3], locale)) { + return "\u65e5\u672c\u5186\u3070\u3064\u3070\u3064\u3002"; + } + } + return null; + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/CurrencyNameProviderImpl2.java 2018-10-16 01:13:04.668446682 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2012, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.bar; - -import java.util.*; -import java.util.spi.*; - -import com.foobar.Utils; - -public class CurrencyNameProviderImpl2 extends CurrencyNameProvider { - static Locale[] avail = {new Locale("ja", "JP", "tokyo"), - new Locale("ja", "JP", "osaka"), }; - public Locale[] getAvailableLocales() { - return avail; - } - - @Override - public String getSymbol(String c, Locale locale) { - if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - if (c.equals("JPY")) { - if (Utils.supportsLocale(avail[0], locale)) { - return "JPY-tokyo"; - } else if (Utils.supportsLocale(avail[1], locale)) { - return "JPY-osaka"; - } - } - return null; - } - - @Override - public String getDisplayName(String c, Locale locale) { - if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - if (c.equals("JPY")) { - if (Utils.supportsLocale(avail[0], locale)) { - return "JPY-tokyo"; - } else if (Utils.supportsLocale(avail[1], locale)) { - return "JPY-osaka"; - } - } - return null; - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/CurrencyNameProviderImpl2.java 2018-10-16 01:13:04.192402534 -0700 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2012, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.bar; + +import java.util.*; +import java.util.spi.*; + +import com.foobar.Utils; + +public class CurrencyNameProviderImpl2 extends CurrencyNameProvider { + static Locale[] avail = {new Locale("ja", "JP", "tokyo"), + new Locale("ja", "JP", "osaka"), }; + public Locale[] getAvailableLocales() { + return avail; + } + + @Override + public String getSymbol(String c, Locale locale) { + if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + if (c.equals("JPY")) { + if (Utils.supportsLocale(avail[0], locale)) { + return "JPY-tokyo"; + } else if (Utils.supportsLocale(avail[1], locale)) { + return "JPY-osaka"; + } + } + return null; + } + + @Override + public String getDisplayName(String c, Locale locale) { + if (!Utils.supportsLocale(Arrays.asList(avail), locale)) { + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + if (c.equals("JPY")) { + if (Utils.supportsLocale(avail[0], locale)) { + return "JPY-tokyo"; + } else if (Utils.supportsLocale(avail[1], locale)) { + return "JPY-osaka"; + } + } + return null; + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/GenericTimeZoneNameProviderImpl.java 2018-10-16 01:13:05.339508915 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2012, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.bar; - -import java.util.*; -import java.util.spi.*; - -import com.foobar.Utils; - -/** - * Implementation class for getGenericTimeZoneName which returns "Generic "+. - */ -public class GenericTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { - static final Locale jaJPGeneric = new Locale("ja", "JP", "generic"); - static final Locale OSAKA = new Locale("ja", "JP", "osaka"); - - static Locale[] avail = { - jaJPGeneric - }; - - @Override - public Locale[] getAvailableLocales() { - return avail; - } - - @Override - public String getGenericDisplayName(String id, int style, Locale locale) { - if (!jaJPGeneric.equals(locale)) { - return null; - } - String std = super.getDisplayName(id, false, style, OSAKA); - return (std != null) ? "Generic " + std : null; - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/GenericTimeZoneNameProviderImpl.java 2018-10-16 01:13:04.870465417 -0700 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2012, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.bar; + +import java.util.*; +import java.util.spi.*; + +import com.foobar.Utils; + +/** + * Implementation class for getGenericTimeZoneName which returns "Generic "+. + */ +public class GenericTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { + static final Locale jaJPGeneric = new Locale("ja", "JP", "generic"); + static final Locale OSAKA = new Locale("ja", "JP", "osaka"); + + static Locale[] avail = { + jaJPGeneric + }; + + @Override + public Locale[] getAvailableLocales() { + return avail; + } + + @Override + public String getGenericDisplayName(String id, int style, Locale locale) { + if (!jaJPGeneric.equals(locale)) { + return null; + } + String std = super.getDisplayName(id, false, style, OSAKA); + return (std != null) ? "Generic " + std : null; + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/LocaleNameProviderImpl.java 2018-10-16 01:13:06.033573282 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2007, 2012, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.bar; - -import java.text.*; -import java.util.*; -import java.util.spi.*; - -import com.foobar.Utils; - -public class LocaleNameProviderImpl extends LocaleNameProvider { - static Locale[] avail = {Locale.JAPANESE, - Locale.JAPAN, - new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - new Locale("xx"), - new Locale("yy", "YY", "YYYY")}; - static List availList = Arrays.asList(avail); - public Locale[] getAvailableLocales() { - return avail; - } - - @Override - public String getDisplayLanguage(String lang, Locale target) { - return getDisplayString(lang, target); - } - - @Override - public String getDisplayCountry(String ctry, Locale target) { - return getDisplayString(ctry, target); - } - - @Override - public String getDisplayVariant(String vrnt, Locale target) { - return getDisplayString(vrnt, target); - } - - private String getDisplayString(String key, Locale target) { - if (!Utils.supportsLocale(availList, target)) { - throw new IllegalArgumentException("locale is not supported: "+target); - } - - String ret = null; - - if (target.getLanguage().equals("yy") && - target.getCountry().equals("YY")) { - String vrnt = target.getVariant(); - if (vrnt.startsWith("YYYY")) { - switch (key) { - case "yy": - case "YY": - ret = "waiwai"; - break; - - case "YYYY": - if (vrnt.equals("YYYY_suffix")) { - // for LocaleNameProviderTest.variantFallbackTest() - throw new RuntimeException(vrnt); - } else { - ret = "waiwai"; - } - break; - } - } - } else { - // resource bundle based (allows fallback) - try { - ResourceBundle rb = ResourceBundle.getBundle("com.bar.LocaleNames", target); - ret = rb.getString(key); - } catch (MissingResourceException mre) { - } - } - - return ret; - } - } --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNameProviderImpl.java 2018-10-16 01:13:05.553528763 -0700 @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2007, 2012, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.bar; + +import java.text.*; +import java.util.*; +import java.util.spi.*; + +import com.foobar.Utils; + +public class LocaleNameProviderImpl extends LocaleNameProvider { + static Locale[] avail = {Locale.JAPANESE, + Locale.JAPAN, + new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + new Locale("xx"), + new Locale("yy", "YY", "YYYY")}; + static List availList = Arrays.asList(avail); + public Locale[] getAvailableLocales() { + return avail; + } + + @Override + public String getDisplayLanguage(String lang, Locale target) { + return getDisplayString(lang, target); + } + + @Override + public String getDisplayCountry(String ctry, Locale target) { + return getDisplayString(ctry, target); + } + + @Override + public String getDisplayVariant(String vrnt, Locale target) { + return getDisplayString(vrnt, target); + } + + private String getDisplayString(String key, Locale target) { + if (!Utils.supportsLocale(availList, target)) { + throw new IllegalArgumentException("locale is not supported: "+target); + } + + String ret = null; + + if (target.getLanguage().equals("yy") && + target.getCountry().equals("YY")) { + String vrnt = target.getVariant(); + if (vrnt.startsWith("YYYY")) { + switch (key) { + case "yy": + case "YY": + ret = "waiwai"; + break; + + case "YYYY": + if (vrnt.equals("YYYY_suffix")) { + // for LocaleNameProviderTest.variantFallbackTest() + throw new RuntimeException(vrnt); + } else { + ret = "waiwai"; + } + break; + } + } + } else { + // resource bundle based (allows fallback) + try { + ResourceBundle rb = ResourceBundle.getBundle("com.bar.LocaleNames", target); + ret = rb.getString(key); + } catch (MissingResourceException mre) { + } + } + + return ret; + } + } --- old/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames.properties 2018-10-16 01:13:06.759640617 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,25 +0,0 @@ -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -osaka=Osaka -kyoto=Kyoto -xx=batsubatsu --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames.properties 2018-10-16 01:13:06.242592667 -0700 @@ -0,0 +1,25 @@ +# +# Copyright (c) 2007, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +osaka=Osaka +kyoto=Kyoto +xx=batsubatsu --- old/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames_ja.properties 2018-10-16 01:13:07.488708230 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,30 +0,0 @@ -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -ja=\u65e5\u672c\u8a9e\u3067\u3059\u3002 -JP=\u65e5\u672c\u3067\u3059\u3002 -# -# added ones -# -osaka=\u5927\u962a\u3067\u3059\u3002 -kyoto=\u4eac\u90fd\u3067\u3059\u3002 -xx=\u3070\u3064\u3070\u3064\u3067\u3059\u3002 --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames_ja.properties 2018-10-16 01:13:06.982661300 -0700 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2007, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +ja=\u65e5\u672c\u8a9e\u3067\u3059\u3002 +JP=\u65e5\u672c\u3067\u3059\u3002 +# +# added ones +# +osaka=\u5927\u962a\u3067\u3059\u3002 +kyoto=\u4eac\u90fd\u3067\u3059\u3002 +xx=\u3070\u3064\u3070\u3064\u3067\u3059\u3002 --- old/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames_ja_JP_kyoto.properties 2018-10-16 01:13:08.201774360 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -ja=\u65e5\u672c\u8a9e\u3069\u3059\u3002 -JP=\u65e5\u672c\u3069\u3059\u3002 -# -osaka=\u5927\u962a\u3069\u3059\u3002 -kyoto=\u4eac\u90fd\u3069\u3059\u3002 -xx=\u307a\u3051\u307a\u3051\u3069\u3059\u3002 --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames_ja_JP_kyoto.properties 2018-10-16 01:13:07.709728728 -0700 @@ -0,0 +1,28 @@ +# +# Copyright (c) 2007, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +ja=\u65e5\u672c\u8a9e\u3069\u3059\u3002 +JP=\u65e5\u672c\u3069\u3059\u3002 +# +osaka=\u5927\u962a\u3069\u3059\u3002 +kyoto=\u4eac\u90fd\u3069\u3059\u3002 +xx=\u307a\u3051\u307a\u3051\u3069\u3059\u3002 --- old/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames_ja_JP_osaka.properties 2018-10-16 01:13:08.880837335 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -ja=\u7956\u56fd\u8a9e\u3084\u3002 -JP=\u3084\u307e\u3068\u3084\u3002 -# -osaka=\u5927\u962a\u3084\u3002 -kyoto=\u4eac\u90fd\u3084\u3002 -xx=\u307a\u3051\u307a\u3051\u3084\u3002 --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames_ja_JP_osaka.properties 2018-10-16 01:13:08.401792909 -0700 @@ -0,0 +1,28 @@ +# +# Copyright (c) 2007, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +ja=\u7956\u56fd\u8a9e\u3084\u3002 +JP=\u3084\u307e\u3068\u3084\u3002 +# +osaka=\u5927\u962a\u3084\u3002 +kyoto=\u4eac\u90fd\u3084\u3002 +xx=\u307a\u3051\u307a\u3051\u3084\u3002 --- old/test/jdk/java/util/PluggableLocale/providersrc/LocaleNames_xx.properties 2018-10-16 01:13:09.564900775 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,23 +0,0 @@ -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -xx=batsubatsu --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/LocaleNames_xx.properties 2018-10-16 01:13:09.093857090 -0700 @@ -0,0 +1,23 @@ +# +# Copyright (c) 2007, 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 +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +xx=batsubatsu --- old/test/jdk/java/util/PluggableLocale/providersrc/TimeZoneNameProviderImpl.java 2018-10-16 01:13:10.241963565 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2007, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.bar; - -import java.util.*; -import java.util.spi.*; - -import com.foobar.Utils; - -public class TimeZoneNameProviderImpl extends TimeZoneNameProvider { - static Locale[] avail = {new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - new Locale("xx"), - Locale.JAPAN}; - - static String[][] zoneOsaka = { - {"GMT", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3084_\u3002", - "G_M_T_\u3084_\u3002", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3084_\u3002", - "G_M_T_\u3084_\u3002"}, - {"JST", - "\u3084_\u307e_\u3068_\u6a19_\u6e96_\u6642_\u3084_\u3002", - "J_S_T_\u3084_\u3002", - "\u3084_\u307e_\u3068_\u6a19_\u6e96_\u6642_\u3084_\u3002", - "J_S_T_\u3084_\u3002"}, - {"America/Los_Angeles", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3084_\u3002", - "P_S_T_\u3084_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3084_\u3002", - "P_D_T_\u3084_\u3002"}, - {"SystemV/PST8", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3084_\u3002", - "P_S_T_\u3084_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3084_\u3002", - "P_D_T_\u3084_\u3002"}, - {"SystemV/PST8PDT", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3084_\u3002", - "P_S_T_\u3084_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3084_\u3002", - "P_D_T_\u3084_\u3002"}, - {"PST8PDT", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3084_\u3002", - "P_S_T_\u3084_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3084_\u3002", - "P_D_T_\u3084_\u3002"}, - }; - - static String[][] zoneKyoto = { - {"GMT", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", - "G_M_T_\u3069_\u3059_\u3002", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", - "G_M_T_\u3069_\u3059_\u3002"}, - {"America/Los_Angeles", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", - "P_S_T_\u3069_\u3059_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3069_\u3059_\u3002", - "P_D_T_\u3069_\u3059_\u3002"}, - {"SystemV/PST8", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", - "P_S_T_\u3069_\u3059_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3069_\u3059_\u3002", - "P_D_T_\u3069_\u3059_\u3002"}, - {"SystemV/PST8PDT", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", - "P_S_T_\u3069_\u3059_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3069_\u3059_\u3002", - "P_D_T_\u3069_\u3059_\u3002"}, - {"PST8PDT", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", - "P_S_T_\u3069_\u3059_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3069_\u3059_\u3002", - "P_D_T_\u3069_\u3059_\u3002"}, - }; - - static String[][] zoneXX = { - {"GMT", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642\u3070\u3064\u3070\u3064\u3002", - "G_M_T_\u3070\u3064\u3070\u3064\u3002", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642\u3070\u3064\u3070\u3064\u3002", - "G_M_T_\u3070\u3064\u3070\u3064\u3002"}, - {"America/Los_Angeles", - "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3070\u3064\u3070\u3064\u3002", - "P_S_T_\u3070\u3064\u3070\u3064\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3070\u3064\u3070\u3064\u3002", - "P_D_T_\u3070\u3064\u3070\u3064\u3002"}}; - - static String[][] zoneJaJP = { - {"GMT", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3067_\u3059_\u3002", - "G_M_T_\u3067_\u3059_\u3002", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3067_\u3059_\u3002", - "G_M_T_\u3067_\u3059_\u3002"}, - {"America/Los_Angeles", - "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3067_\u3059_\u3002", - "P_S_T_\u3067_\u3059_\u3002", - "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3067_\u3059_\u3002", - "P_D_T_\u3067_\u3059_\u3002"}}; - - static String[][][] names = {zoneOsaka, zoneKyoto, zoneXX, zoneJaJP}; - - public Locale[] getAvailableLocales() { - return avail; - } - - public String getDisplayName(String id, boolean dst, int style, Locale language) { - if (!Utils.supportsLocale(Arrays.asList(avail), language)) { - throw new IllegalArgumentException("locale is not one of available locales: "+language); - } - - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], language)) { - String[][] namesForALocale = names[i]; - for (int j = 0; j < namesForALocale.length; j++) { - String[] array = namesForALocale[j]; - if (id.equals(array[0])) { - String ret = array[(style==TimeZone.LONG?0:1)+(dst?2:0)+1]; - return ret; - } - } - } - } - return null; - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/barprovider/com/bar/TimeZoneNameProviderImpl.java 2018-10-16 01:13:09.766919510 -0700 @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2007, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.bar; + +import java.util.*; +import java.util.spi.*; + +import com.foobar.Utils; + +public class TimeZoneNameProviderImpl extends TimeZoneNameProvider { + static Locale[] avail = {new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + new Locale("xx"), + Locale.JAPAN}; + + static String[][] zoneOsaka = { + {"GMT", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3084_\u3002", + "G_M_T_\u3084_\u3002", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3084_\u3002", + "G_M_T_\u3084_\u3002"}, + {"JST", + "\u3084_\u307e_\u3068_\u6a19_\u6e96_\u6642_\u3084_\u3002", + "J_S_T_\u3084_\u3002", + "\u3084_\u307e_\u3068_\u6a19_\u6e96_\u6642_\u3084_\u3002", + "J_S_T_\u3084_\u3002"}, + {"America/Los_Angeles", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3084_\u3002", + "P_S_T_\u3084_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3084_\u3002", + "P_D_T_\u3084_\u3002"}, + {"SystemV/PST8", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3084_\u3002", + "P_S_T_\u3084_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3084_\u3002", + "P_D_T_\u3084_\u3002"}, + {"SystemV/PST8PDT", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3084_\u3002", + "P_S_T_\u3084_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3084_\u3002", + "P_D_T_\u3084_\u3002"}, + {"PST8PDT", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3084_\u3002", + "P_S_T_\u3084_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3084_\u3002", + "P_D_T_\u3084_\u3002"}, + }; + + static String[][] zoneKyoto = { + {"GMT", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", + "G_M_T_\u3069_\u3059_\u3002", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", + "G_M_T_\u3069_\u3059_\u3002"}, + {"America/Los_Angeles", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", + "P_S_T_\u3069_\u3059_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3069_\u3059_\u3002", + "P_D_T_\u3069_\u3059_\u3002"}, + {"SystemV/PST8", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", + "P_S_T_\u3069_\u3059_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3069_\u3059_\u3002", + "P_D_T_\u3069_\u3059_\u3002"}, + {"SystemV/PST8PDT", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", + "P_S_T_\u3069_\u3059_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3069_\u3059_\u3002", + "P_D_T_\u3069_\u3059_\u3002"}, + {"PST8PDT", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3069_\u3059_\u3002", + "P_S_T_\u3069_\u3059_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3069_\u3059_\u3002", + "P_D_T_\u3069_\u3059_\u3002"}, + }; + + static String[][] zoneXX = { + {"GMT", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642\u3070\u3064\u3070\u3064\u3002", + "G_M_T_\u3070\u3064\u3070\u3064\u3002", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642\u3070\u3064\u3070\u3064\u3002", + "G_M_T_\u3070\u3064\u3070\u3064\u3002"}, + {"America/Los_Angeles", + "\u592a_\u5e73_\u6d0b_\u6a19_\u6e96_\u6642_\u3070\u3064\u3070\u3064\u3002", + "P_S_T_\u3070\u3064\u3070\u3064\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3070\u3064\u3070\u3064\u3002", + "P_D_T_\u3070\u3064\u3070\u3064\u3002"}}; + + static String[][] zoneJaJP = { + {"GMT", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3067_\u3059_\u3002", + "G_M_T_\u3067_\u3059_\u3002", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3067_\u3059_\u3002", + "G_M_T_\u3067_\u3059_\u3002"}, + {"America/Los_Angeles", + "\u30b0_\u30ea_\u30cb_\u30c3_\u30b8_\u6a19_\u6e96_\u6642_\u3067_\u3059_\u3002", + "P_S_T_\u3067_\u3059_\u3002", + "\u592a_\u5e73_\u6d0b_\u590f_\u6642_\u9593_\u3067_\u3059_\u3002", + "P_D_T_\u3067_\u3059_\u3002"}}; + + static String[][][] names = {zoneOsaka, zoneKyoto, zoneXX, zoneJaJP}; + + public Locale[] getAvailableLocales() { + return avail; + } + + public String getDisplayName(String id, boolean dst, int style, Locale language) { + if (!Utils.supportsLocale(Arrays.asList(avail), language)) { + throw new IllegalArgumentException("locale is not one of available locales: "+language); + } + + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], language)) { + String[][] namesForALocale = names[i]; + for (int j = 0; j < namesForALocale.length; j++) { + String[] array = namesForALocale[j]; + if (id.equals(array[0])) { + String ret = array[(style==TimeZone.LONG?0:1)+(dst?2:0)+1]; + return ret; + } + } + } + } + return null; + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/Utils.java 2018-10-16 01:13:10.938028117 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2007, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ -package com.foobar; -import java.util.*; - -public class Utils { - public static boolean supportsLocale(Locale supported, Locale requested) { - if (supported.getLanguage() == "") { - return true; - } else if (supported.getLanguage() != requested.getLanguage()) { - return false; - } - - if (supported.getCountry() == "") { - return true; - } else if (supported.getCountry() != requested.getCountry()) { - return false; - } - - String supVar = supported.getVariant(); - String reqVar = requested.getVariant(); - - if (supVar == "") { - return true; - } else { - int underIndex; - while ((underIndex = reqVar.lastIndexOf('_')) != (-1)) { - reqVar = reqVar.substring(0, underIndex); - if (supVar.equals(reqVar)) { - return true; - } - } - return supVar.equals(reqVar); - } - } - - public static boolean supportsLocale(List supported, Locale requested) { - for (Locale l : supported) { - if (supportsLocale(l, requested)) { - return true; - } - } - return false; - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/foobarutils/com/foobar/Utils.java 2018-10-16 01:13:10.461983969 -0700 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2007, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ +package com.foobar; +import java.util.*; + +public class Utils { + public static boolean supportsLocale(Locale supported, Locale requested) { + if (supported.getLanguage() == "") { + return true; + } else if (supported.getLanguage() != requested.getLanguage()) { + return false; + } + + if (supported.getCountry() == "") { + return true; + } else if (supported.getCountry() != requested.getCountry()) { + return false; + } + + String supVar = supported.getVariant(); + String reqVar = requested.getVariant(); + + if (supVar == "") { + return true; + } else { + int underIndex; + while ((underIndex = reqVar.lastIndexOf('_')) != (-1)) { + reqVar = reqVar.substring(0, underIndex); + if (supVar.equals(reqVar)) { + return true; + } + } + return supVar.equals(reqVar); + } + } + + public static boolean supportsLocale(List supported, Locale requested) { + for (Locale l : supported) { + if (supportsLocale(l, requested)) { + return true; + } + } + return false; + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.BreakIteratorProvider 2018-10-16 01:13:11.666095638 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.text.spi.BreakIteratorProvider -# implementation class -# -com.foo.BreakIteratorProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.BreakIteratorProvider 2018-10-16 01:13:11.166049264 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.text.spi.BreakIteratorProvider +# implementation class +# +com.foo.BreakIteratorProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.CollatorProvider 2018-10-16 01:13:12.380161859 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.text.spi.CollatorProvider -# implementation class -# -com.foo.CollatorProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.CollatorProvider 2018-10-16 01:13:11.885115949 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.text.spi.CollatorProvider +# implementation class +# +com.foo.CollatorProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.DateFormatProvider 2018-10-16 01:13:13.047223722 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.text.spi.DateFormatProvider -# implementation class -# -com.foo.DateFormatProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.DateFormatProvider 2018-10-16 01:13:12.591181429 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.text.spi.DateFormatProvider +# implementation class +# +com.foo.DateFormatProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.DateFormatSymbolsProvider 2018-10-16 01:13:13.719286049 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.text.spi.DateFormatProvider -# implementation class -# -com.foo.DateFormatSymbolsProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.DateFormatSymbolsProvider 2018-10-16 01:13:13.250242550 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.text.spi.DateFormatProvider +# implementation class +# +com.foo.DateFormatSymbolsProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.DecimalFormatSymbolsProvider 2018-10-16 01:13:14.389348190 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.text.spi.DecimalFormatProvider -# implementation class -# -com.foo.DecimalFormatSymbolsProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider 2018-10-16 01:13:13.926305247 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.text.spi.DecimalFormatProvider +# implementation class +# +com.foo.DecimalFormatSymbolsProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/java.text.spi.NumberFormatProvider 2018-10-16 01:13:15.057410145 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,7 +0,0 @@ -# -# -# -# fully-qualified name of the java.text.spi.NumberFormatProvider -# implementation class -# -com.foo.NumberFormatProviderImpl --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/META-INF/services/java.text.spi.NumberFormatProvider 2018-10-16 01:13:14.593367110 -0700 @@ -0,0 +1,7 @@ +# +# +# +# fully-qualified name of the java.text.spi.NumberFormatProvider +# implementation class +# +com.foo.NumberFormatProviderImpl --- old/test/jdk/java/util/PluggableLocale/providersrc/BreakIteratorProviderImpl.java 2018-10-16 01:13:15.766475903 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2007, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.foo; - -import java.text.*; -import java.text.spi.*; -import java.util.*; -import com.foobar.Utils; - -public class BreakIteratorProviderImpl extends BreakIteratorProvider { - - static Locale[] avail = { - Locale.JAPAN, - new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - new Locale("xx", "YY")}; - - static String[] dialect = { - "\u3067\u3059\u3002", - "\u3084\u3002", - "\u3069\u3059\u3002", - "-xx-YY" - }; - - static enum Type {CHARACTER, LINE, SENTENCE, WORD}; - - public Locale[] getAvailableLocales() { - return avail; - } - - public BreakIterator getCharacterInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - return new FooBreakIterator(Type.CHARACTER, i); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - public BreakIterator getLineInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - return new FooBreakIterator(Type.LINE, i); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - public BreakIterator getSentenceInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - return new FooBreakIterator(Type.SENTENCE, i); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - public BreakIterator getWordInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - return new FooBreakIterator(Type.WORD, i); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - // dummy implementation - class FooBreakIterator extends BreakIterator { - public FooBreakIterator(Type t, int index) { - super(); - } - - public int current() { - return 0; - } - - public int first() { - return 0; - } - - public int following(int offset) { - return 0; - } - - public CharacterIterator getText() { - return null; - } - - public boolean isBoundary(int offset) { - return true; - } - - public int last() { - return 0; - } - - public int next() { - return 0; - } - - public int next(int n) { - return 0; - } - - public int preceding(int offset) { - return 0; - } - - public int previous() { - return 0; - } - - public void setText(CharacterIterator ci) { - } - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/BreakIteratorProviderImpl.java 2018-10-16 01:13:15.297432405 -0700 @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2007, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.foo; + +import java.text.*; +import java.text.spi.*; +import java.util.*; +import com.foobar.Utils; + +public class BreakIteratorProviderImpl extends BreakIteratorProvider { + + static Locale[] avail = { + Locale.JAPAN, + new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + new Locale("xx", "YY")}; + + static String[] dialect = { + "\u3067\u3059\u3002", + "\u3084\u3002", + "\u3069\u3059\u3002", + "-xx-YY" + }; + + static enum Type {CHARACTER, LINE, SENTENCE, WORD}; + + public Locale[] getAvailableLocales() { + return avail; + } + + public BreakIterator getCharacterInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + return new FooBreakIterator(Type.CHARACTER, i); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + public BreakIterator getLineInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + return new FooBreakIterator(Type.LINE, i); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + public BreakIterator getSentenceInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + return new FooBreakIterator(Type.SENTENCE, i); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + public BreakIterator getWordInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + return new FooBreakIterator(Type.WORD, i); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + // dummy implementation + class FooBreakIterator extends BreakIterator { + public FooBreakIterator(Type t, int index) { + super(); + } + + public int current() { + return 0; + } + + public int first() { + return 0; + } + + public int following(int offset) { + return 0; + } + + public CharacterIterator getText() { + return null; + } + + public boolean isBoundary(int offset) { + return true; + } + + public int last() { + return 0; + } + + public int next() { + return 0; + } + + public int next(int n) { + return 0; + } + + public int preceding(int offset) { + return 0; + } + + public int previous() { + return 0; + } + + public void setText(CharacterIterator ci) { + } + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/CollatorProviderImpl.java 2018-10-16 01:13:16.440538415 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2007, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.foo; - -import java.text.*; -import java.text.spi.*; -import java.util.*; - -import com.foobar.Utils; - -public class CollatorProviderImpl extends CollatorProvider { - - static Locale[] avail = { - Locale.JAPAN, - new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - new Locale("xx", "YY", "ZZZZ")}; - - static String[] dialect = { - "\u3067\u3059\u3002", - "\u3084\u3002", - "\u3069\u3059\u3002", - "-xx-YY-ZZZZ" - }; - - public Locale[] getAvailableLocales() { - return avail; - } - - public Collator getInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - RuleBasedCollator ja = (RuleBasedCollator)Collator.getInstance(Locale.JAPANESE); - try { - return new RuleBasedCollator(ja.getRules()+"& Z < "+dialect[i]); - } catch (ParseException pe) { -System.err.println(pe+ja.getRules()+"& Z < "+dialect[i]); - return ja; - } - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/CollatorProviderImpl.java 2018-10-16 01:13:15.978495566 -0700 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2007, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.foo; + +import java.text.*; +import java.text.spi.*; +import java.util.*; + +import com.foobar.Utils; + +public class CollatorProviderImpl extends CollatorProvider { + + static Locale[] avail = { + Locale.JAPAN, + new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + new Locale("xx", "YY", "ZZZZ")}; + + static String[] dialect = { + "\u3067\u3059\u3002", + "\u3084\u3002", + "\u3069\u3059\u3002", + "-xx-YY-ZZZZ" + }; + + public Locale[] getAvailableLocales() { + return avail; + } + + public Collator getInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + RuleBasedCollator ja = (RuleBasedCollator)Collator.getInstance(Locale.JAPANESE); + try { + return new RuleBasedCollator(ja.getRules()+"& Z < "+dialect[i]); + } catch (ParseException pe) { +System.err.println(pe+ja.getRules()+"& Z < "+dialect[i]); + return ja; + } + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/DateFormatProviderImpl.java 2018-10-16 01:13:17.118601298 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2007, 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.foo; - -import java.text.*; -import java.text.spi.*; -import java.util.*; - -import com.foobar.Utils; - -public class DateFormatProviderImpl extends DateFormatProvider { - - static Locale[] avail = { - Locale.JAPAN, - new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - new Locale("yy")}; - - static String[] datePattern = { - "yyyy'\u5e74'M'\u6708'd'\u65e5'", // full date pattern - "yyyy/MMM/dd", // long date pattern - "yyyy/MM/dd", // medium date pattern - "yy/MM/dd" // short date pattern - }; - - static String[] timePattern = { - "H'\u6642'mm'\u5206'ss'\u79d2' z", // full time pattern - "H:mm:ss z", // long time pattern - "H:mm:ss", // medium time pattern - "H:mm" // short time pattern - }; - - static String[] dialect = { - "\u3067\u3059\u3002", - "\u3084\u3002", - "\u3069\u3059\u3002", - "\u308f\u3044\u308f\u3044" - }; - - public Locale[] getAvailableLocales() { - return avail; - } - - public DateFormat getDateInstance(int style, Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - return new FooDateFormat(datePattern[style]+dialect[i], locale); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - public DateFormat getTimeInstance(int style, Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - return new FooDateFormat(timePattern[style]+dialect[i], locale); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - public DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - return new FooDateFormat( - datePattern[dateStyle]+" "+timePattern[timeStyle]+dialect[i], locale); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/DateFormatProviderImpl.java 2018-10-16 01:13:16.654558263 -0700 @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2007, 2010, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.foo; + +import java.text.*; +import java.text.spi.*; +import java.util.*; + +import com.foobar.Utils; + +public class DateFormatProviderImpl extends DateFormatProvider { + + static Locale[] avail = { + Locale.JAPAN, + new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + new Locale("yy")}; + + static String[] datePattern = { + "yyyy'\u5e74'M'\u6708'd'\u65e5'", // full date pattern + "yyyy/MMM/dd", // long date pattern + "yyyy/MM/dd", // medium date pattern + "yy/MM/dd" // short date pattern + }; + + static String[] timePattern = { + "H'\u6642'mm'\u5206'ss'\u79d2' z", // full time pattern + "H:mm:ss z", // long time pattern + "H:mm:ss", // medium time pattern + "H:mm" // short time pattern + }; + + static String[] dialect = { + "\u3067\u3059\u3002", + "\u3084\u3002", + "\u3069\u3059\u3002", + "\u308f\u3044\u308f\u3044" + }; + + public Locale[] getAvailableLocales() { + return avail; + } + + public DateFormat getDateInstance(int style, Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + return new FooDateFormat(datePattern[style]+dialect[i], locale); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + public DateFormat getTimeInstance(int style, Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + return new FooDateFormat(timePattern[style]+dialect[i], locale); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + public DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + return new FooDateFormat( + datePattern[dateStyle]+" "+timePattern[timeStyle]+dialect[i], locale); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/DateFormatSymbolsProviderImpl.java 2018-10-16 01:13:17.776662326 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2007, 2012, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.foo; - -import java.text.*; -import java.text.spi.*; -import java.util.*; - -import com.foobar.Utils; - -public class DateFormatSymbolsProviderImpl extends DateFormatSymbolsProvider { - - static Locale[] avail = { - new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - Locale.JAPAN, - new Locale("yy", "ZZ") - }; - static List availList = Arrays.asList(avail); - - static String[] dialect = { - "\u3084\u3002", - "\u3069\u3059\u3002", - "\u3067\u3059\u3002", - "-yy-ZZ" - }; - - static Map symbols = new HashMap(4); - - public Locale[] getAvailableLocales() { - return avail; - } - - public DateFormatSymbols getInstance(Locale locale) { - if (!Utils.supportsLocale(availList, locale)) { - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - FooDateFormatSymbols fdfs = symbols.get(locale); - if (fdfs == null) { - for (int index = 0; index < avail.length; index ++) { - if (Utils.supportsLocale(avail[index], locale)) { - fdfs = new FooDateFormatSymbols(index); - symbols.put(locale, fdfs); - break; - } - } - } - return fdfs; - } - - class FooDateFormatSymbols extends DateFormatSymbols { - String dialect = ""; - - String[] eras = null; - String[] months = null; - String[] shortMonths = null; - String[] weekdays = null; - String[] shortWeekdays = null; - String[] ampms = null; - - public FooDateFormatSymbols(int index) { - super(DateFormatSymbolsProviderImpl.this.avail[index]); - dialect = DateFormatSymbolsProviderImpl.this.dialect[index]; - } - - public String[] getEras() { - if (eras == null) { - eras = super.getEras(); - for (int i = 0; i < eras.length; i++) { - eras[i] = eras[i]+dialect; - } - } - return eras; - } - - /** - * Sets era strings. For example: "AD" and "BC". - * @param newEras the new era strings. - */ - public void setEras(String[] newEras) { - eras = newEras; - } - - /** - * Gets month strings. For example: "January", "February", etc. - * @return the month strings. - */ - public String[] getMonths() { - if (months == null) { - months = super.getMonths(); - for (int i = 0; i < months.length; i++) { - months[i] = months[i]+dialect; - } - } - return months; - } - - /** - * Sets month strings. For example: "January", "February", etc. - * @param newMonths the new month strings. - */ - public void setMonths(String[] newMonths) { - months = newMonths; - } - - /** - * Gets short month strings. For example: "Jan", "Feb", etc. - * @return the short month strings. - */ - public String[] getShortMonths() { - if (shortMonths == null) { - shortMonths = super.getShortMonths(); - for (int i = 0; i < shortMonths.length; i++) { - shortMonths[i] = shortMonths[i]+dialect; - } - } - return shortMonths; - } - - /** - * Sets short month strings. For example: "Jan", "Feb", etc. - * @param newShortMonths the new short month strings. - */ - public void setShortMonths(String[] newShortMonths) { - shortMonths = newShortMonths; - } - - /** - * Gets weekday strings. For example: "Sunday", "Monday", etc. - * @return the weekday strings. Use Calendar.SUNDAY, - * Calendar.MONDAY, etc. to index the result array. - */ - public String[] getWeekdays() { - if (weekdays == null) { - weekdays = super.getWeekdays(); - for (int i = 0; i < weekdays.length; i++) { - weekdays[i] = weekdays[i]+dialect; - } - } - return weekdays; - } - - /** - * Sets weekday strings. For example: "Sunday", "Monday", etc. - * @param newWeekdays the new weekday strings. The array should - * be indexed by Calendar.SUNDAY, - * Calendar.MONDAY, etc. - */ - public void setWeekdays(String[] newWeekdays) { - weekdays = newWeekdays; - } - - /** - * Gets short weekday strings. For example: "Sun", "Mon", etc. - * @return the short weekday strings. Use Calendar.SUNDAY, - * Calendar.MONDAY, etc. to index the result array. - */ - public String[] getShortWeekdays() { - if (shortWeekdays == null) { - shortWeekdays = super.getShortWeekdays(); - for (int i = 0; i < shortWeekdays.length; i++) { - shortWeekdays[i] = shortWeekdays[i]+dialect; - } - } - return shortWeekdays; - } - - /** - * Sets short weekday strings. For example: "Sun", "Mon", etc. - * @param newShortWeekdays the new short weekday strings. The array should - * be indexed by Calendar.SUNDAY, - * Calendar.MONDAY, etc. - */ - public void setShortWeekdays(String[] newShortWeekdays) { - shortWeekdays = newShortWeekdays; - } - - /** - * Gets ampm strings. For example: "AM" and "PM". - * @return the ampm strings. - */ - public String[] getAmPmStrings() { - if (ampms == null) { - ampms = super.getAmPmStrings(); - for (int i = 0; i < ampms.length; i++) { - ampms[i] = ampms[i]+dialect; - } - } - return ampms; - } - - /** - * Sets ampm strings. For example: "AM" and "PM". - * @param newAmpms the new ampm strings. - */ - public void setAmPmStrings(String[] newAmpms) { - ampms = newAmpms; - } - - @Override - public String[][] getZoneStrings() { - return new String[0][0]; - } - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/DateFormatSymbolsProviderImpl.java 2018-10-16 01:13:17.320620033 -0700 @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2007, 2012, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.foo; + +import java.text.*; +import java.text.spi.*; +import java.util.*; + +import com.foobar.Utils; + +public class DateFormatSymbolsProviderImpl extends DateFormatSymbolsProvider { + + static Locale[] avail = { + new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + Locale.JAPAN, + new Locale("yy", "ZZ") + }; + static List availList = Arrays.asList(avail); + + static String[] dialect = { + "\u3084\u3002", + "\u3069\u3059\u3002", + "\u3067\u3059\u3002", + "-yy-ZZ" + }; + + static Map symbols = new HashMap(4); + + public Locale[] getAvailableLocales() { + return avail; + } + + public DateFormatSymbols getInstance(Locale locale) { + if (!Utils.supportsLocale(availList, locale)) { + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + FooDateFormatSymbols fdfs = symbols.get(locale); + if (fdfs == null) { + for (int index = 0; index < avail.length; index ++) { + if (Utils.supportsLocale(avail[index], locale)) { + fdfs = new FooDateFormatSymbols(index); + symbols.put(locale, fdfs); + break; + } + } + } + return fdfs; + } + + class FooDateFormatSymbols extends DateFormatSymbols { + String dialect = ""; + + String[] eras = null; + String[] months = null; + String[] shortMonths = null; + String[] weekdays = null; + String[] shortWeekdays = null; + String[] ampms = null; + + public FooDateFormatSymbols(int index) { + super(DateFormatSymbolsProviderImpl.this.avail[index]); + dialect = DateFormatSymbolsProviderImpl.this.dialect[index]; + } + + public String[] getEras() { + if (eras == null) { + eras = super.getEras(); + for (int i = 0; i < eras.length; i++) { + eras[i] = eras[i]+dialect; + } + } + return eras; + } + + /** + * Sets era strings. For example: "AD" and "BC". + * @param newEras the new era strings. + */ + public void setEras(String[] newEras) { + eras = newEras; + } + + /** + * Gets month strings. For example: "January", "February", etc. + * @return the month strings. + */ + public String[] getMonths() { + if (months == null) { + months = super.getMonths(); + for (int i = 0; i < months.length; i++) { + months[i] = months[i]+dialect; + } + } + return months; + } + + /** + * Sets month strings. For example: "January", "February", etc. + * @param newMonths the new month strings. + */ + public void setMonths(String[] newMonths) { + months = newMonths; + } + + /** + * Gets short month strings. For example: "Jan", "Feb", etc. + * @return the short month strings. + */ + public String[] getShortMonths() { + if (shortMonths == null) { + shortMonths = super.getShortMonths(); + for (int i = 0; i < shortMonths.length; i++) { + shortMonths[i] = shortMonths[i]+dialect; + } + } + return shortMonths; + } + + /** + * Sets short month strings. For example: "Jan", "Feb", etc. + * @param newShortMonths the new short month strings. + */ + public void setShortMonths(String[] newShortMonths) { + shortMonths = newShortMonths; + } + + /** + * Gets weekday strings. For example: "Sunday", "Monday", etc. + * @return the weekday strings. Use Calendar.SUNDAY, + * Calendar.MONDAY, etc. to index the result array. + */ + public String[] getWeekdays() { + if (weekdays == null) { + weekdays = super.getWeekdays(); + for (int i = 0; i < weekdays.length; i++) { + weekdays[i] = weekdays[i]+dialect; + } + } + return weekdays; + } + + /** + * Sets weekday strings. For example: "Sunday", "Monday", etc. + * @param newWeekdays the new weekday strings. The array should + * be indexed by Calendar.SUNDAY, + * Calendar.MONDAY, etc. + */ + public void setWeekdays(String[] newWeekdays) { + weekdays = newWeekdays; + } + + /** + * Gets short weekday strings. For example: "Sun", "Mon", etc. + * @return the short weekday strings. Use Calendar.SUNDAY, + * Calendar.MONDAY, etc. to index the result array. + */ + public String[] getShortWeekdays() { + if (shortWeekdays == null) { + shortWeekdays = super.getShortWeekdays(); + for (int i = 0; i < shortWeekdays.length; i++) { + shortWeekdays[i] = shortWeekdays[i]+dialect; + } + } + return shortWeekdays; + } + + /** + * Sets short weekday strings. For example: "Sun", "Mon", etc. + * @param newShortWeekdays the new short weekday strings. The array should + * be indexed by Calendar.SUNDAY, + * Calendar.MONDAY, etc. + */ + public void setShortWeekdays(String[] newShortWeekdays) { + shortWeekdays = newShortWeekdays; + } + + /** + * Gets ampm strings. For example: "AM" and "PM". + * @return the ampm strings. + */ + public String[] getAmPmStrings() { + if (ampms == null) { + ampms = super.getAmPmStrings(); + for (int i = 0; i < ampms.length; i++) { + ampms[i] = ampms[i]+dialect; + } + } + return ampms; + } + + /** + * Sets ampm strings. For example: "AM" and "PM". + * @param newAmpms the new ampm strings. + */ + public void setAmPmStrings(String[] newAmpms) { + ampms = newAmpms; + } + + @Override + public String[][] getZoneStrings() { + return new String[0][0]; + } + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/DecimalFormatSymbolsProviderImpl.java 2018-10-16 01:13:18.451724931 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2007, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.foo; - -import java.text.*; -import java.text.spi.*; -import java.util.*; - -import com.foobar.Utils; - -public class DecimalFormatSymbolsProviderImpl extends DecimalFormatSymbolsProvider { - - static Locale[] avail = { - new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - Locale.JAPAN, - new Locale("yy", "ZZ", "UUU") - }; - static List availList = Arrays.asList(avail); - - static String[] dialect = { - "\u3084\u3002", - "\u3069\u3059\u3002", - "\u3067\u3059\u3002", - "-yy-ZZ-UUU" - }; - - static HashMap symbols = new HashMap(4); - - public Locale[] getAvailableLocales() { - return avail; - } - - public DecimalFormatSymbols getInstance(Locale locale) { - if (!Utils.supportsLocale(availList, locale)) { - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - FooDecimalFormatSymbols fdfs = symbols.get(locale); - if (fdfs == null) { - for (int index = 0; index < avail.length; index ++) { - if (Utils.supportsLocale(avail[index], locale)) { - fdfs = new FooDecimalFormatSymbols(index); - symbols.put(locale, fdfs); - break; - } - } - } - return fdfs; - } - - class FooDecimalFormatSymbols extends DecimalFormatSymbols { - String dialect = ""; - - String infinity = null; - String nan = null; - - public FooDecimalFormatSymbols(int index) { - super(DecimalFormatSymbolsProviderImpl.this.avail[index]); - dialect = DecimalFormatSymbolsProviderImpl.this.dialect[index]; - } - - // overrides methods only returns Strings - public String getInfinity() { - if (infinity == null) { - infinity = super.getInfinity() + dialect; - } - return infinity; - } - - public void setInfinity(String infinity) { - this.infinity = infinity; - } - - public String getNaN() { - if (nan == null) { - nan = super.getNaN() + dialect; - } - return nan; - } - - public void setNaN(String nan) { - this.nan = nan; - } - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/DecimalFormatSymbolsProviderImpl.java 2018-10-16 01:13:17.981681340 -0700 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2007, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.foo; + +import java.text.*; +import java.text.spi.*; +import java.util.*; + +import com.foobar.Utils; + +public class DecimalFormatSymbolsProviderImpl extends DecimalFormatSymbolsProvider { + + static Locale[] avail = { + new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + Locale.JAPAN, + new Locale("yy", "ZZ", "UUU") + }; + static List availList = Arrays.asList(avail); + + static String[] dialect = { + "\u3084\u3002", + "\u3069\u3059\u3002", + "\u3067\u3059\u3002", + "-yy-ZZ-UUU" + }; + + static HashMap symbols = new HashMap(4); + + public Locale[] getAvailableLocales() { + return avail; + } + + public DecimalFormatSymbols getInstance(Locale locale) { + if (!Utils.supportsLocale(availList, locale)) { + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + FooDecimalFormatSymbols fdfs = symbols.get(locale); + if (fdfs == null) { + for (int index = 0; index < avail.length; index ++) { + if (Utils.supportsLocale(avail[index], locale)) { + fdfs = new FooDecimalFormatSymbols(index); + symbols.put(locale, fdfs); + break; + } + } + } + return fdfs; + } + + class FooDecimalFormatSymbols extends DecimalFormatSymbols { + String dialect = ""; + + String infinity = null; + String nan = null; + + public FooDecimalFormatSymbols(int index) { + super(DecimalFormatSymbolsProviderImpl.this.avail[index]); + dialect = DecimalFormatSymbolsProviderImpl.this.dialect[index]; + } + + // overrides methods only returns Strings + public String getInfinity() { + if (infinity == null) { + infinity = super.getInfinity() + dialect; + } + return infinity; + } + + public void setInfinity(String infinity) { + this.infinity = infinity; + } + + public String getNaN() { + if (nan == null) { + nan = super.getNaN() + dialect; + } + return nan; + } + + public void setNaN(String nan) { + this.nan = nan; + } + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/FooDateFormat.java 2018-10-16 01:13:19.113786330 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.foo; - -import java.text.*; -import java.util.*; - -/** - * FooDateFormat provides SimpleDateFormat methods required for the SPI testing. - */ -public class FooDateFormat extends DateFormat { - private SimpleDateFormat sdf; - - public FooDateFormat(String pattern, Locale loc) { - sdf = new SimpleDateFormat(pattern, loc); - } - - @Override - public StringBuffer format(Date date, - StringBuffer toAppendTo, - FieldPosition fieldPosition) { - return sdf.format(date, toAppendTo, fieldPosition); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return sdf.parse(source, pos); - } - - @Override - public boolean equals(Object other) { - return other instanceof FooDateFormat - && sdf.equals(((FooDateFormat)other).sdf); - } - - @Override - public int hashCode() { - return sdf.hashCode(); - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/FooDateFormat.java 2018-10-16 01:13:18.649743295 -0700 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2010, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.foo; + +import java.text.*; +import java.util.*; + +/** + * FooDateFormat provides SimpleDateFormat methods required for the SPI testing. + */ +public class FooDateFormat extends DateFormat { + private SimpleDateFormat sdf; + + public FooDateFormat(String pattern, Locale loc) { + sdf = new SimpleDateFormat(pattern, loc); + } + + @Override + public StringBuffer format(Date date, + StringBuffer toAppendTo, + FieldPosition fieldPosition) { + return sdf.format(date, toAppendTo, fieldPosition); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return sdf.parse(source, pos); + } + + @Override + public boolean equals(Object other) { + return other instanceof FooDateFormat + && sdf.equals(((FooDateFormat)other).sdf); + } + + @Override + public int hashCode() { + return sdf.hashCode(); + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/FooNumberFormat.java 2018-10-16 01:13:19.792849306 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.foo; - -import java.text.*; - -/** - * FooNumberFormat provides DecimalFormat methods required for the SPI testing. - */ -public class FooNumberFormat extends NumberFormat { - private DecimalFormat df; - - public FooNumberFormat(String pattern, DecimalFormatSymbols dfs) { - df = new DecimalFormat(pattern, dfs); - } - - @Override - public StringBuffer format(double number, - StringBuffer toAppendTo, - FieldPosition pos) { - return df.format(number, toAppendTo, pos); - } - - @Override - public StringBuffer format(long number, - StringBuffer toAppendTo, - FieldPosition pos) { - return df.format(number, toAppendTo, pos); - } - - @Override - public Number parse(String source, ParsePosition parsePosition) { - return df.parse(source, parsePosition); - } - - @Override - public boolean equals(Object other) { - return other instanceof FooNumberFormat - && df.equals(((FooNumberFormat)other).df); - } - - @Override - public int hashCode() { - return df.hashCode(); - } - - // DecimalFormat specific methods required for testing - - public String toPattern() { - return df.toPattern(); - } - - public DecimalFormatSymbols getDecimalFormatSymbols() { - return df.getDecimalFormatSymbols(); - } - - public void setDecimalSeparatorAlwaysShown(boolean newValue) { - df.setDecimalSeparatorAlwaysShown(newValue); - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/FooNumberFormat.java 2018-10-16 01:13:19.319805436 -0700 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.foo; + +import java.text.*; + +/** + * FooNumberFormat provides DecimalFormat methods required for the SPI testing. + */ +public class FooNumberFormat extends NumberFormat { + private DecimalFormat df; + + public FooNumberFormat(String pattern, DecimalFormatSymbols dfs) { + df = new DecimalFormat(pattern, dfs); + } + + @Override + public StringBuffer format(double number, + StringBuffer toAppendTo, + FieldPosition pos) { + return df.format(number, toAppendTo, pos); + } + + @Override + public StringBuffer format(long number, + StringBuffer toAppendTo, + FieldPosition pos) { + return df.format(number, toAppendTo, pos); + } + + @Override + public Number parse(String source, ParsePosition parsePosition) { + return df.parse(source, parsePosition); + } + + @Override + public boolean equals(Object other) { + return other instanceof FooNumberFormat + && df.equals(((FooNumberFormat)other).df); + } + + @Override + public int hashCode() { + return df.hashCode(); + } + + // DecimalFormat specific methods required for testing + + public String toPattern() { + return df.toPattern(); + } + + public DecimalFormatSymbols getDecimalFormatSymbols() { + return df.getDecimalFormatSymbols(); + } + + public void setDecimalSeparatorAlwaysShown(boolean newValue) { + df.setDecimalSeparatorAlwaysShown(newValue); + } +} --- old/test/jdk/java/util/PluggableLocale/providersrc/NumberFormatProviderImpl.java 2018-10-16 01:13:20.463911540 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2007, 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* - * - */ - -package com.foo; - -import java.text.*; -import java.text.spi.*; -import java.util.*; - -import com.foobar.Utils; - -public class NumberFormatProviderImpl extends NumberFormatProvider { - - static Locale[] avail = { - Locale.JAPAN, - new Locale("ja", "JP", "osaka"), - new Locale("ja", "JP", "kyoto"), - new Locale("zz")}; - - static String[] dialect = { - "\u3067\u3059\u3002", - "\u3084\u3002", - "\u3069\u3059\u3002", - "-zz" - }; - - static String[] patterns = { - "#,##0.###{0};-#,##0.###{1}", // decimal pattern - "#{0};(#){1}", // integer pattern - "\u00A4#,##0{0};-\u00A4#,##0{1}", // currency pattern - "#,##0%{0}" // percent pattern - }; - // Constants used by factory methods to specify a style of format. - static final int NUMBERSTYLE = 0; - static final int INTEGERSTYLE = 1; - static final int CURRENCYSTYLE = 2; - static final int PERCENTSTYLE = 3; - - public Locale[] getAvailableLocales() { - return avail; - } - - public NumberFormat getCurrencyInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - String pattern = - MessageFormat.format(patterns[CURRENCYSTYLE], - dialect[i], - dialect[i]); - FooNumberFormat nf = new FooNumberFormat(pattern, - DecimalFormatSymbols.getInstance(locale)); - adjustForCurrencyDefaultFractionDigits(nf); - return nf; - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - public NumberFormat getIntegerInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - String pattern = - MessageFormat.format(patterns[INTEGERSTYLE], - dialect[i], - dialect[i]); - FooNumberFormat nf = new FooNumberFormat(pattern, - DecimalFormatSymbols.getInstance(locale)); - nf.setMaximumFractionDigits(0); - nf.setDecimalSeparatorAlwaysShown(false); - nf.setParseIntegerOnly(true); - return nf; - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - public NumberFormat getNumberInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - String pattern = - MessageFormat.format(patterns[NUMBERSTYLE], - dialect[i], - dialect[i]); - return new FooNumberFormat(pattern, - DecimalFormatSymbols.getInstance(locale)); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - public NumberFormat getPercentInstance(Locale locale) { - for (int i = 0; i < avail.length; i ++) { - if (Utils.supportsLocale(avail[i], locale)) { - String pattern = - MessageFormat.format(patterns[PERCENTSTYLE], - dialect[i]); - return new FooNumberFormat(pattern, - DecimalFormatSymbols.getInstance(locale)); - } - } - throw new IllegalArgumentException("locale is not supported: "+locale); - } - - /** - * Adjusts the minimum and maximum fraction digits to values that - * are reasonable for the currency's default fraction digits. - */ - void adjustForCurrencyDefaultFractionDigits(FooNumberFormat nf) { - DecimalFormatSymbols dfs = nf.getDecimalFormatSymbols(); - Currency currency = dfs.getCurrency(); - if (currency == null) { - try { - currency = Currency.getInstance(dfs.getInternationalCurrencySymbol()); - } catch (IllegalArgumentException e) { - } - } - if (currency != null) { - int digits = currency.getDefaultFractionDigits(); - if (digits != -1) { - int oldMinDigits = nf.getMinimumFractionDigits(); - // Common patterns are "#.##", "#.00", "#". - // Try to adjust all of them in a reasonable way. - if (oldMinDigits == nf.getMaximumFractionDigits()) { - nf.setMinimumFractionDigits(digits); - nf.setMaximumFractionDigits(digits); - } else { - nf.setMinimumFractionDigits(Math.min(digits, oldMinDigits)); - nf.setMaximumFractionDigits(digits); - } - } - } - } -} --- /dev/null 2018-09-21 21:06:18.538000000 -0700 +++ new/test/jdk/java/util/PluggableLocale/providersrc/fooprovider/com/foo/NumberFormatProviderImpl.java 2018-10-16 01:13:19.988867484 -0700 @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2007, 2010, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * + */ + +package com.foo; + +import java.text.*; +import java.text.spi.*; +import java.util.*; + +import com.foobar.Utils; + +public class NumberFormatProviderImpl extends NumberFormatProvider { + + static Locale[] avail = { + Locale.JAPAN, + new Locale("ja", "JP", "osaka"), + new Locale("ja", "JP", "kyoto"), + new Locale("zz")}; + + static String[] dialect = { + "\u3067\u3059\u3002", + "\u3084\u3002", + "\u3069\u3059\u3002", + "-zz" + }; + + static String[] patterns = { + "#,##0.###{0};-#,##0.###{1}", // decimal pattern + "#{0};(#){1}", // integer pattern + "\u00A4#,##0{0};-\u00A4#,##0{1}", // currency pattern + "#,##0%{0}" // percent pattern + }; + // Constants used by factory methods to specify a style of format. + static final int NUMBERSTYLE = 0; + static final int INTEGERSTYLE = 1; + static final int CURRENCYSTYLE = 2; + static final int PERCENTSTYLE = 3; + + public Locale[] getAvailableLocales() { + return avail; + } + + public NumberFormat getCurrencyInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + String pattern = + MessageFormat.format(patterns[CURRENCYSTYLE], + dialect[i], + dialect[i]); + FooNumberFormat nf = new FooNumberFormat(pattern, + DecimalFormatSymbols.getInstance(locale)); + adjustForCurrencyDefaultFractionDigits(nf); + return nf; + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + public NumberFormat getIntegerInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + String pattern = + MessageFormat.format(patterns[INTEGERSTYLE], + dialect[i], + dialect[i]); + FooNumberFormat nf = new FooNumberFormat(pattern, + DecimalFormatSymbols.getInstance(locale)); + nf.setMaximumFractionDigits(0); + nf.setDecimalSeparatorAlwaysShown(false); + nf.setParseIntegerOnly(true); + return nf; + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + public NumberFormat getNumberInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + String pattern = + MessageFormat.format(patterns[NUMBERSTYLE], + dialect[i], + dialect[i]); + return new FooNumberFormat(pattern, + DecimalFormatSymbols.getInstance(locale)); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + public NumberFormat getPercentInstance(Locale locale) { + for (int i = 0; i < avail.length; i ++) { + if (Utils.supportsLocale(avail[i], locale)) { + String pattern = + MessageFormat.format(patterns[PERCENTSTYLE], + dialect[i]); + return new FooNumberFormat(pattern, + DecimalFormatSymbols.getInstance(locale)); + } + } + throw new IllegalArgumentException("locale is not supported: "+locale); + } + + /** + * Adjusts the minimum and maximum fraction digits to values that + * are reasonable for the currency's default fraction digits. + */ + void adjustForCurrencyDefaultFractionDigits(FooNumberFormat nf) { + DecimalFormatSymbols dfs = nf.getDecimalFormatSymbols(); + Currency currency = dfs.getCurrency(); + if (currency == null) { + try { + currency = Currency.getInstance(dfs.getInternationalCurrencySymbol()); + } catch (IllegalArgumentException e) { + } + } + if (currency != null) { + int digits = currency.getDefaultFractionDigits(); + if (digits != -1) { + int oldMinDigits = nf.getMinimumFractionDigits(); + // Common patterns are "#.##", "#.00", "#". + // Try to adjust all of them in a reasonable way. + if (oldMinDigits == nf.getMaximumFractionDigits()) { + nf.setMinimumFractionDigits(digits); + nf.setMaximumFractionDigits(digits); + } else { + nf.setMinimumFractionDigits(Math.min(digits, oldMinDigits)); + nf.setMaximumFractionDigits(digits); + } + } + } + } +} --- old/test/jdk/java/util/PluggableLocale/BreakIteratorProviderTest.sh 2018-10-16 01:13:21.085969229 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 2016, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 8062588 8165804 -# @summary BreakIteratorProvider tests -# @run shell ExecTest.sh foo BreakIteratorProviderTest --- old/test/jdk/java/util/PluggableLocale/CalendarDataProviderTest.sh 2018-10-16 01:13:21.802035636 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 7058207 8000986 8062588 -# @summary CalendarDataProvider tests -# @run shell ExecTest.sh bar CalendarDataProviderTest --- old/test/jdk/java/util/PluggableLocale/CalendarNameProviderTest.sh 2018-10-16 01:13:22.427093604 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,27 +0,0 @@ -# -# Copyright (c) 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# @test -# @bug 8000986 8062588 -# @summary CalendarNameProvider tests -# @run shell ExecTest.sh bar CalendarNameProviderTest --- old/test/jdk/java/util/PluggableLocale/ClasspathTest.sh 2018-10-16 01:13:23.060152313 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 6388652 8062588 -# @summary Checks whether providers can be loaded from classpath. -# @run shell ExecTest.sh bar ClasspathTest --- old/test/jdk/java/util/PluggableLocale/CollatorProviderTest.sh 2018-10-16 01:13:23.685210280 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 8062588 -# @summary CollatorProvider tests -# @run shell ExecTest.sh foo CollatorProviderTest --- old/test/jdk/java/util/PluggableLocale/CurrencyNameProviderTest.sh 2018-10-16 01:13:24.316268804 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 7199750 8000997 8062588 -# @summary CurrencyNameProvider tests -# @run shell ExecTest.sh bar CurrencyNameProviderTest --- old/test/jdk/java/util/PluggableLocale/DateFormatProviderTest.sh 2018-10-16 01:13:24.943326957 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 2010, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 7003643 8062588 -# @summary DateFormatProvider tests -# @run shell ExecTest.sh foo DateFormatProviderTest --- old/test/jdk/java/util/PluggableLocale/DateFormatSymbolsProviderTest.sh 2018-10-16 01:13:25.568384925 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 7200341 8062588 -# @summary DateFormatSymbolsProvider tests -# @run shell ExecTest.sh foo DateFormatSymbolsProviderTest --- old/test/jdk/java/util/PluggableLocale/DecimalFormatSymbolsProviderTest.sh 2018-10-16 01:13:26.198443356 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 8062588 -# @summary DecimalFormatSymbolsProvider tests -# @run shell ExecTest.sh foo DecimalFormatSymbolsProviderTest --- old/test/jdk/java/util/PluggableLocale/ExecTest.sh 2018-10-16 01:13:26.848503642 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,145 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# -# -# This script is the actual launcher of each locale service provider test. -# fooprovider.jar contains localized object providers and barprovider.jar -# contains localized name providers. This way, we can test providers that -# can relate to each other (such as, DateFormatSymbolsProvider and -# TimeZoneNameProvider) separately. -# -# Parameters: -# providersToTest: [foo|bar|foobar] -# java class name: -# java security policy file: (Optional. Installs security manager if exists) - -if [ "${TESTSRC}" = "" ] -then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTSRC=${TESTSRC}" -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi -if [ "${COMPILEJAVA}" = "" ] -then - COMPILEJAVA="${TESTJAVA}" -fi -echo "TESTJAVA=${TESTJAVA}" -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTCLASSES=${TESTCLASSES}" -echo "CLASSPATH=${CLASSPATH}" - -# set platform-dependent variables -OS=`uname -s` -case "$OS" in - SunOS | Linux | Darwin | AIX ) - PS=":" - FS="/" - ;; - Windows* | CYGWIN* ) - PS=";" - FS="\\" - ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; -esac - -case "$1" in - "foo" ) - cp ${TESTSRC}${FS}fooprovider.jar ${TESTCLASSES} - CLASSPATHARG=".${PS}${TESTSRC}${PS}${TESTSRC}${FS}fooprovider.jar" - ;; - "bar" ) - cp ${TESTSRC}${FS}barprovider.jar ${TESTCLASSES} - CLASSPATHARG=".${PS}${TESTSRC}${PS}${TESTSRC}${FS}barprovider.jar" - ;; - "foobar" ) - cp ${TESTSRC}${FS}fooprovider.jar ${TESTCLASSES} - cp ${TESTSRC}${FS}barprovider.jar ${TESTCLASSES} - CLASSPATHARG=".${PS}${TESTSRC}${PS}${TESTSRC}${FS}fooprovider.jar${PS}${TESTSRC}${PS}${TESTSRC}${FS}barprovider.jar" - ;; -esac - - -EXTRA_OPTS="--add-exports java.base/sun.util.locale.provider=ALL-UNNAMED \ - --add-exports java.base/sun.util.resources=ALL-UNNAMED" - -# compile -cp ${TESTSRC}${FS}ProviderTest.java . -cp ${TESTSRC}${FS}$2.java . -COMPILE="${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${EXTRA_OPTS} \ - -XDignore.symbol.file -d . -classpath ${CLASSPATHARG} $2.java" -echo ${COMPILE} -${COMPILE} -result=$? - -if [ $result -eq 0 ] -then - echo "Compilation of the test case was successful." -else - echo "Compilation of the test case failed." - # Cleanup - rm -f ${TESTCLASSES}${FS}$2*.class - rm -f ${TESTCLASSES}${FS}fooprovider.jar - rm -f ${TESTCLASSES}${FS}barprovider.jar - exit $result -fi - -# security options -if [ "$3" != "" ] -then - SECURITYOPTS="-Djava.security.manager -Djava.security.policy=${TESTSRC}${FS}$3" -fi - -# run -RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${EXTRA_OPTS} ${SECURITYOPTS} -classpath ${CLASSPATHARG} -Djava.locale.providers=JRE,SPI $2 " - -echo ${RUNCMD} -${RUNCMD} -result=$? - -if [ $result -eq 0 ] -then - echo "Execution successful" -else - echo "Execution of the test case failed." -fi - -# Cleanup -rm -f ${TESTCLASSES}${FS}$2*.class -rm -f ${TESTCLASSES}${FS}fooprovider.jar -rm -f ${TESTCLASSES}${FS}barprovider.jar - -exit $result --- old/test/jdk/java/util/PluggableLocale/GenericTest.sh 2018-10-16 01:13:27.500564113 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 8062588 -# @summary Generic tests for the pluggable locales feature -# @run shell ExecTest.sh foobar GenericTest --- old/test/jdk/java/util/PluggableLocale/LocaleNameProviderTest.sh 2018-10-16 01:13:28.136623101 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 8000273 8062588 -# @summary LocaleNameProvider tests -# @run shell ExecTest.sh bar LocaleNameProviderTest --- old/test/jdk/java/util/PluggableLocale/NumberFormatProviderTest.sh 2018-10-16 01:13:28.757680697 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 2010, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 7003643 8062588 -# @summary NumberFormatProvider tests -# @run shell ExecTest.sh foo NumberFormatProviderTest --- old/test/jdk/java/util/PluggableLocale/PermissionTest.sh 2018-10-16 01:13:29.371737644 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,31 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 8075545 -# @summary Check whether RuntimePermission("localeServiceProvider") is -# handled correctly -# @run shell ExecTest.sh foobar PermissionTest -# @run shell/fail ExecTest.sh foobar PermissionTest dummy -# @run shell ExecTest.sh foobar PermissionTest localeServiceProvider.policy --- old/test/jdk/java/util/PluggableLocale/TimeZoneNameProviderTest.sh 2018-10-16 01:13:29.964792644 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2007, 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# -# @test -# @bug 4052440 8003267 8062588 -# @summary TimeZoneNameProvider tests -# @run shell ExecTest.sh bar TimeZoneNameProviderTest --- old/test/jdk/java/util/PluggableLocale/providersrc/Makefile 2018-10-16 01:13:32.310010138 -0700 +++ /dev/null 2018-09-21 21:06:18.538000000 -0700 @@ -1,78 +0,0 @@ -# -# -# - -DESTDIR=.. -FOODIR=foo-contents -BARDIR=bar-contents - -all: $(DESTDIR)/fooprovider.jar $(DESTDIR)/barprovider.jar - -FOOSERVICES = \ - java.text.spi.BreakIteratorProvider \ - java.text.spi.CollatorProvider \ - java.text.spi.DateFormatProvider \ - java.text.spi.DateFormatSymbolsProvider \ - java.text.spi.DecimalFormatSymbolsProvider \ - java.text.spi.NumberFormatProvider - -BARSERVICES = \ - java.util.spi.CurrencyNameProvider \ - java.util.spi.TimeZoneNameProvider \ - java.util.spi.LocaleNameProvider \ - java.util.spi.CalendarDataProvider \ - java.util.spi.CalendarNameProvider - -FOOFILES_JAVA = \ - BreakIteratorProviderImpl.java \ - CollatorProviderImpl.java \ - DateFormatProviderImpl.java \ - DateFormatSymbolsProviderImpl.java \ - DecimalFormatSymbolsProviderImpl.java \ - NumberFormatProviderImpl.java \ - FooDateFormat.java \ - FooNumberFormat.java \ - Utils.java - -BARFILES_JAVA = \ - CurrencyNameProviderImpl.java \ - CurrencyNameProviderImpl2.java \ - TimeZoneNameProviderImpl.java \ - GenericTimeZoneNameProviderImpl.java \ - LocaleNameProviderImpl.java \ - CalendarDataProviderImpl.java \ - CalendarNameProviderImpl.java \ - Utils.java - -BARFILES_PROPERTIES = \ - LocaleNames.properties \ - LocaleNames_ja.properties \ - LocaleNames_ja_JP_osaka.properties \ - LocaleNames_ja_JP_kyoto.properties \ - LocaleNames_xx.properties - -$(DESTDIR)/fooprovider.jar: $(FOOSERVICES) $(FOOFILES_JAVA) - rm -rf $(FOODIR) - mkdir -p $(FOODIR) - mkdir -p $(FOODIR)/META-INF - mkdir -p $(FOODIR)/META-INF/services - $(BINDIR)/javac -d $(FOODIR) $(FOOFILES_JAVA) - cp $(FOOSERVICES) $(FOODIR)/META-INF/services - rm -f $(DESTDIR)/fooprovider.jar - $(BINDIR)/jar cvf $(DESTDIR)/fooprovider.jar -C $(FOODIR) . - -$(DESTDIR)/barprovider.jar: $(BARSERVICES) $(BARFILES_JAVA) $(BARFILES_PROPERTIES) - rm -rf $(BARDIR) - mkdir -p $(BARDIR) - mkdir -p $(BARDIR)/META-INF - mkdir -p $(BARDIR)/META-INF/services - $(BINDIR)/javac -d $(BARDIR) $(BARFILES_JAVA) - cp $(BARSERVICES) $(BARDIR)/META-INF/services - cp $(BARFILES_PROPERTIES) $(BARDIR)/com/bar - rm -f $(DESTDIR)/barprovider.jar - $(BINDIR)/jar cvf $(DESTDIR)/barprovider.jar -C $(BARDIR) . - -clean: - rm -rf $(BARDIR) $(FOODIR) - -.PHONY: all clean