Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Mar 2007 06:28:34 -0700
From:      Victor Igumnov <lamer0@gmail.com>
To:        freebsd-java@freebsd.org
Subject:   Re: diablo jvm issue, at the byte code level
Message-ID:  <3707F016-B450-4E5E-9CA2-DB72FA5A4E70@gmail.com>
In-Reply-To: <43632782-B042-4464-BB36-A76F205B49DD@gmail.com>
References:  <635C86FC-5150-4528-972E-A5E99418D0A9@salesdepotinc.com> <1174033677.1588.5.camel@exponent> <43632782-B042-4464-BB36-A76F205B49DD@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> It isn't a Locale issue, seems like a bytecode issue plain and  
> simple. If compiled with the Diablo JVM it works correctly. The  
> reason I choose to use Java for this project is the fact that the  
> bytecode would be interchangable between JVMs/platforms. If I am  
> running into issues this early, this makes me weary.
>
> -Victor
>
>
>
> On Mar 16, 2007, at 1:27 AM, Calvin Varney wrote:
>
>> This could be a locale problem rather than a Diablo jvm one. What
>> happens if you specify the local when invoking  
>> getCurrencyInstance, e.g.
>> NumberFormat.getCurrencyInstance(Locale.US);
>>
>> See
>> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using- 
>> localization.html for setting you locale.
>>
>> cheers
>>
>> Calvin.
>>
>> On Thu, 2007-03-15 at 14:25 -0700, victori@salesdepotinc.com wrote:
>>> Anonuser has posted on my behalf, seems like this issue with
>>> NumberFormat is 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
>>>
>>>
>>> Works correctly.
>>>
>>>
>>> _______________________________________________
>>> freebsd-java@freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-java
>>> To unsubscribe, send any mail to "freebsd-java- 
>>> unsubscribe@freebsd.org"
>>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3707F016-B450-4E5E-9CA2-DB72FA5A4E70>