JDK-7199794 : Collator provider from SPI Adapter is loaded when they are assumed to be from JRE adapter
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2012-09-20
  • Updated: 2012-09-20
  • Resolved: 2012-09-20
Related Reports
Relates :  
Relates :  
Description
One collator provider implementation that supports locale de_DE is in the java extension directory. The test program runs 
"RuleBasedCollator collator = (RuleBasedCollator) Collator.getInstance(new Locale ("de", "DE"));" to get the Collator intance of de_DE.

When running the test program, no adapter is specified in Djava.locale.providers. The default value, "JRE,SPI", is used.

In the java release before 8 b55, where there is no adapter, the rule of JRE is returned. JRE supports de_DE, so the provider in SPI is not loaded.

Beginning from 8 b55, where there is the adapter, the rule of SPI is provided. It seems that the fall back is de_DE in SPI first. 

This breaks the compatibility. For some locales, existing java program that does not specify adapter will return different Collator provider since b55.

Attached are the source of provider, the provider jar file, the test program, and the screen shot of test output.

Comments
EVALUATION This is the expected behavior with the implementation of 7171324. Although JRE supports de_DE collation, it actually falls back to the default collation data (no de_DE specific collation data is provided). So the SPI implementation which explicitly supports de_DE is honored in such a case.
20-09-2012