Skip to content

8355522: Remove the java.locale.useOldISOCodes system property #26419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

naotoj
Copy link
Member

@naotoj naotoj commented Jul 21, 2025

This PR removes the system property deprecated in JDK 25. If the property is specified at runtime, a warning will be emitted at startup to inform the user that the value is ignored. A corresponding CSR has been drafted as well


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8362953 to be approved

Issues

  • JDK-8355522: Remove the java.locale.useOldISOCodes system property (Bug - P4)
  • JDK-8362953: Remove the java.locale.useOldISOCodes system property (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26419/head:pull/26419
$ git checkout pull/26419

Update a local copy of the PR:
$ git checkout pull/26419
$ git pull https://git.openjdk.org/jdk.git pull/26419/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26419

View PR using the GUI difftool:
$ git pr show -t 26419

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26419.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 21, 2025

👋 Welcome back naoto! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 21, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added csr Pull request needs approved CSR before integration rfr Pull request is ready for review labels Jul 21, 2025
@openjdk
Copy link

openjdk bot commented Jul 21, 2025

@naotoj The following labels will be automatically applied to this pull request:

  • core-libs
  • i18n

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@mlbridge
Copy link

mlbridge bot commented Jul 21, 2025

Webrevs

Copy link
Member

@justin-curtis-lu justin-curtis-lu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also remove the test method, ModuleTestUtil.runModuleWithLegacyCode which passes the now defunct property to the process.

}

static class Runner {
private static final String obsoleteCode = "iw";
private static final String newCode = "he";

public static void main(String[] args) {
// Ensure java.locale.useOldISOCodes is only interpreted at runtime startup
// Should have no effect
// Ensure java.locale.useOldISOCodes should have no effect
System.setProperty("java.locale.useOldISOCodes", "false");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, it seems weird to keep this line in the test, even if it has no effect. The original goal was to ensure the property only had impact when set during startup. The current test is no longer concerned with that (since the property no longer performs any mapping).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I re-purposed the test but as you mentioned, the line is confusing. Removed.

@naotoj
Copy link
Member Author

naotoj commented Jul 22, 2025

Should we also remove the test method, ModuleTestUtil.runModuleWithLegacyCode which passes the now defunct property to the process.

I thought about that, but decided to leave it as it is, just to make sure everything works as before. For the same reason, I did not remove the -Djava.locale.useOldISOCodes=true run in LocaleTest.java

@@ -183,9 +180,9 @@ public static BaseLocale getInstance(String language, String script,

public static String convertOldISOCodes(String language) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was there before this change, but above on line 166 I think we should update the outdated comment,

// JDK uses deprecated ISO639.1 language codes for he, yi and id

Copy link
Member

@justin-curtis-lu justin-curtis-lu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -534,28 +534,9 @@
* {@code in}. Since Java SE 17, this is no longer the case. Each
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 * <p>Locale's constructors have always converted three language codes to
 * their earlier, obsoleted forms: {@code he} maps to {@code iw},
 * {@code yi} maps to {@code ji}, and {@code id} maps to
 * {@code in}. Since Java SE 17, this is no longer the case.

This history was relevant when the property existed. Since this is no longer the case, and we're quite a few releases away from 17, can we also remove this wording as well. Users on 26 should only be concerned with the "old" to "modern" mapping.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Modified the unnecesarry history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] csr Pull request needs approved CSR before integration i18n [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants