Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8236790 | 15 | Naoto Sato | P4 | Resolved | Fixed | b05 |
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.
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.
- backported by
-
JDK-8236790 open/test/jdk/java/util/Locale/LocaleProvidersRun.java failed on mac 10.14 with de_DE locale.
- Resolved
- relates to
-
JDK-8232860 Error formatting integer values with MessageFormat.format() using HOST provider
- Resolved