Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7199794

Collator provider from SPI Adapter is loaded when they are assumed to be from JRE adapter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 8
    • core-libs
    • generic
    • generic

      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.

            naoto Naoto Sato
            yhuang Yong Huang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: