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

open/test/jdk/java/util/Locale/LocaleProvidersRun.java failed on mac 10.14 with de_DE locale.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b31
    • CPU:
      x86_64
    • OS:
      os_x

      Backports

        Description

        Test jdk: Oracle jdk 14 build 28
        OS: Mac mini 10.14 with de_DE locale
        Error log:
        Exception in thread "main" java.lang.RuntimeException: Incorrect number format. input: 123.4, expected: 123.4, result: 123,4
        at LocaleProviders.lambda$bug8232860Test$0(LocaleProviders.java:353)
        at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)
        at java.base/java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:593)
        at LocaleProviders.bug8232860Test(LocaleProviders.java:348)
        at LocaleProviders.main(LocaleProviders.java:92)

        Using following test code to debug:
        public class TestHostProvider{
        public static void main(String[] args){
        NumberFormat numf = NumberFormat.getNumberInstance(Locale.US);
        NumberFormat intf = NumberFormat.getIntegerInstance(Locale.US);
        DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(Locale.US);

        System.out.println("NumberFormat: " + numf.format(123.4));
        System.out.println("IntegerFormat: " + intf.format(1234));

        System.out.println("DecimalSeparator: " + df.getDecimalFormatSymbols().getDecimalSeparator());
        System.out.println("GroupingSeparator: " + df.getDecimalFormatSymbols().getGroupingSeparator());
        }
        }
        When running above test code using HOST provider on mac 10.14 with de_DE locale:
        java -Djava.locale.providers=HOST TestHostProvider
        Expected result:
        NumberFormat: 123.4
        IntegerFormat: 1,234
        DecimalSeparator: .
        GroupingSeparator: ,
        Actual result:
        NumberFormat: 123,4
        IntegerFormat: 1.234
        DecimalSeparator: ,
        GroupingSeparator: .

        The Locale.US in NumberFormat.getNumberInstance(Locale.US), NumberFormat.getIntegerInstance(Locale.US) and DecimalFormat.getInstance(Locale.US) does not work.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  naoto Naoto Sato
                  Reporter:
                  dzhou Dora Zhou
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: