From owner-freebsd-java@FreeBSD.ORG Fri Mar 16 09:39:46 2007 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F52516A401 for ; Fri, 16 Mar 2007 09:39:46 +0000 (UTC) (envelope-from calvin.varney@gmail.com) Received: from mxsrv4.tranzpeer.net (mxsrv4.tranzpeer.net [202.180.66.217]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1B013C448 for ; Fri, 16 Mar 2007 09:39:46 +0000 (UTC) (envelope-from calvin.varney@gmail.com) Received: from 202-180-123-137.jetbuster.co.nz ([202.180.123.137] helo=[192.168.1.10]) by mxsrv4.tranzpeer.net with ESMTP (Exim 4.50) id 1HS7mF-0001ID-Mh; Fri, 16 Mar 2007 21:27:07 +1300 From: Calvin Varney To: "victori@salesdepotinc.com" In-Reply-To: <635C86FC-5150-4528-972E-A5E99418D0A9@salesdepotinc.com> References: <635C86FC-5150-4528-972E-A5E99418D0A9@salesdepotinc.com> Content-Type: text/plain Date: Fri, 16 Mar 2007 21:27:57 +1300 Message-Id: <1174033677.1588.5.camel@exponent> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-java@freebsd.org Subject: Re: diablo jvm issue, at the byte code level X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2007 09:39:46 -0000 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"