-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
9
-
generic
-
generic
FULL PRODUCT VERSION :
java version "9"
Java(TM) SE Runtime Environment (build 9+179)
Java HotSpot(TM) Server VM (build 9+179, mixed mode, emulated-client, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.14393]
A DESCRIPTION OF THE PROBLEM :
NumberFormat.getPercentInstance().parse(String) can not parse a percent value.
REGRESSION. Last worked in version 8u152
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the test program.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.text.ParseException: Unparseable number: "75%"
at java.base/java.text.NumberFormat.parse(Unknown Source)
at TestJava9.main(TestJava9.java:7)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.NumberFormat;
import java.text.ParseException;
public class TestJava9 {
public static void main( String[] args ) throws ParseException {
double value = NumberFormat.getPercentInstance().parse( "75%" ).doubleValue();
System.out.println( value );
}
}
---------- END SOURCE ----------
java version "9"
Java(TM) SE Runtime Environment (build 9+179)
Java HotSpot(TM) Server VM (build 9+179, mixed mode, emulated-client, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.14393]
A DESCRIPTION OF THE PROBLEM :
NumberFormat.getPercentInstance().parse(String) can not parse a percent value.
REGRESSION. Last worked in version 8u152
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the test program.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.text.ParseException: Unparseable number: "75%"
at java.base/java.text.NumberFormat.parse(Unknown Source)
at TestJava9.main(TestJava9.java:7)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.NumberFormat;
import java.text.ParseException;
public class TestJava9 {
public static void main( String[] args ) throws ParseException {
double value = NumberFormat.getPercentInstance().parse( "75%" ).doubleValue();
System.out.println( value );
}
}
---------- END SOURCE ----------
- relates to
-
JDK-4510618 [Fmt-Nu] French thousands separator is non-breaking space
-
- Closed
-