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

java.util.spi.LocaleServiceProvider spec contains statement that is too strict

    XMLWordPrintable

Details

    Description

      Specification for java.util.spi.LocaleServiceProvider
      ( https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/spi/LocaleServiceProvider.html#java.locale.providers )

      says:
      ========
      The search order of locale sensitive services can be configured by using the java.locale.providers system property. This system property declares the user's preferred order for looking up the locale sensitive services separated by a comma. It is only read at the Java runtime startup, so the later call to System.setProperty() won't affect the order.
      ========

      However as experiments show it seems that for OpenJDK programmatic setting of System.setProperty() still affects the implementation behaviour - say if a simple program is started with

        -Djava.locale.providers=SPI

      and then the program itself calls

        System.setProperty("java.locale.providers", "CLDR,COMPAT”)

      this would lead to behavior different than the expected SPI-type defined at Java runtime startup.

      Attachments

        Issue Links

          Activity

            People

              naoto Naoto Sato
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: