JDK-8269531 : Clarify the spec wrt `useOldISOCodes` system property
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 17
  • Submitted: 2021-06-28
  • Updated: 2021-08-31
  • Resolved: 2021-06-30
Related Reports
CSR :  
Description
Summary
-------

Clarify the description of `java.locale.useOldISOCodes` system property so that users won't be misguided about the behavior.

Problem
-------

The system property is only read at the runtime startup time, so it is expected that `System.setProperty()` has no effect on the behavior, users would expect that the behavior would be changed based on the `setProperty()` value.

Solution
--------

Add some text, somewhere along the line with the system property is only read at the runtime startup.

Specification
-------------

Replace the paragraph that describes the `java.locale.useOldISOCodes` system property in the class description of `java.util.Locale`

from:

     * <p>For the backward compatible behavior, the system property
     * {@systemProperty java.locale.useOldISOCodes} reverts the behavior
     * back to prior to Java SE 17 one. If the system property is set
     * to {@code true}, those three current language codes are mapped to their
     * backward compatible forms.

to:

     * <p>For the backward compatible behavior, the system property
     * {@systemProperty java.locale.useOldISOCodes} reverts the behavior
     * back to that of before Java SE 17. If the system property is set to
     * {@code true}, those three current language codes are mapped to their
     * backward compatible forms. The property is only read at Java runtime
     * startup and subsequent calls to {@code System.setProperty()} will
     * have no effect.



Comments
Moving to Approved. I trust the "only read at startup and afterward has no effect" wording here is consistent with other usages in the JDK.
30-06-2021