8138613: Remove SPI locale provider adapter from the default provider list
Reviewed-by: okutsu
--- a/jdk/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java Mon Oct 05 17:38:04 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/spi/LocaleServiceProvider.java Mon Oct 05 08:16:11 2015 -0700
@@ -140,8 +140,10 @@
* desired locale sensitive service is not available, then the runtime looks for CLDR,
* JRE in that order.
* <p>
- * The default order for looking up the preferred locale providers is "CLDR,JRE,SPI",
- * so specifying "CLDR,JRE,SPI" is identical to the default behavior.
+ * The default order for looking up the preferred locale providers is "CLDR,JRE",
+ * so specifying "CLDR,JRE" is identical to the default behavior. Applications which
+ * require implementations of the locale sensitive services must explicitly specify
+ * "SPI" in order for the Java runtime to load them from the classpath.
*
* @since 1.6
*/
--- a/jdk/src/java.base/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java Mon Oct 05 17:38:04 2015 +0300
+++ b/jdk/src/java.base/share/classes/sun/util/locale/provider/LocaleProviderAdapter.java Mon Oct 05 08:16:11 2015 -0700
@@ -185,7 +185,6 @@
LocaleServiceProviderPool.config(LocaleProviderAdapter.class, e.toString());
}
typeList.add(Type.JRE);
- typeList.add(Type.SPI);
defaultLocaleProviderAdapter = Type.JRE;
}
--- a/jdk/test/java/util/Locale/Bug8008577.java Mon Oct 05 17:38:04 2015 +0300
+++ b/jdk/test/java/util/Locale/Bug8008577.java Mon Oct 05 08:16:11 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8008577
+ * @bug 8008577 8138613
* @summary Check whether CLDR locale provider adapter is enabled by default
* @compile -XDignore.symbol.file Bug8008577.java
* @run main Bug8008577
@@ -38,7 +38,6 @@
static final LocaleProviderAdapter.Type[] expected = {
LocaleProviderAdapter.Type.CLDR,
LocaleProviderAdapter.Type.JRE,
- LocaleProviderAdapter.Type.SPI,
};
public static void main(String[] args) {