All pastes #396626 Raw Edit

Someone

public text v1 · immutable
·published 2007-03-15 21:57 UTC
rendered paste body
It seems like this issue is with NumberFormat at the bytecode level

Here is an example testcase:

import java.text.*;

public class Test {
   public static void main(String[] args) {
    try {
     System.out.println(NumberFormat.getCurrencyInstance().parse("$1.99").doubleValue());
    } catch (Exception e) {
     e.printStackTrace();
    }
   }
}

Save as Test.java ; compile under the SUN JVM:  javac Test.java


Run the class under the Diablo jvm and you will receive

-bash-2.05b$ java Test
java.text.ParseException: Unparseable number: "$1.99"
        at java.text.NumberFormat.parse(NumberFormat.java:309)
        at Test.main(Test.java:6)

And when I run it with the SUN JDK

absolute# /usr/local/linux-sun-jdk1.5.0/bin/java Test
1.99


If you can't compile Ill provide what I have,

http://salesdepotinc.com/Test.java
http://salesdepotinc.com/Test.class  (compiled with sun jdk)



Works correctly.