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

Clarify the spec wrt `useOldISOCodes` system property

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b25
    • Introduced In Version:
      17
    • Resolved In Build:
      b30

      Backports

        Description

        Hebrew/Indonesian/Yiddish ISO 639 language codes failed to work in backward compatible manner even if system property java.locale.useOldISOCodes sets to true.

        Code snippet:
        import java.util.Locale;
        public class Test1 {
            public static void main(String[] args) {
                System.setProperty("java.locale.useOldISOCodes","true");
                new Test1().test();
            }
            String languages[] = new String[]{"he", "yi", "id"};
            String excepted[] = new String[]{"iw", "ji", "in"};
            private void test() {
                Locale locale = null;
                for (int i = 0; i < languages.length; i++) {
                    locale = new Locale(languages[i]);
                    if (excepted[i] != null) {
                        if (!locale.getLanguage().equals(excepted[i])) {
                            System.out.println(
                                    "getLanguage returned wrong value : "
                                            + locale.getLanguage()
                                            + " language = " + excepted[i]
                            );
                        }
                    }
                }
            }
        }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                naoto Naoto Sato
                Reporter:
                amadgundi Asha Madgundi
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: