From owner-freebsd-java@FreeBSD.ORG Fri Mar 16 18:15:37 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 4CD8216A405 for ; Fri, 16 Mar 2007 18:15:37 +0000 (UTC) (envelope-from lamer0@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.225]) by mx1.freebsd.org (Postfix) with ESMTP id 0701313C468 for ; Fri, 16 Mar 2007 18:15:36 +0000 (UTC) (envelope-from lamer0@gmail.com) Received: by nz-out-0506.google.com with SMTP id r28so237889nza for ; Fri, 16 Mar 2007 11:15:36 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=UxkB2twTBuUbL5JAGymQ+uJWRpcS7LApKzbOtzcXg6dP3Ucw0dsdHIkMpzOd6sFPN2OgUY22HUi+0slLGetVr/A15v1fzrdUvnsP2Ej4DKtyTTOi0dkrgfA+D+IMcMIa+cRDKW6UiYmc+pEuT4GfxbMAzI5cip5v7KyswIUzcx0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=UJgbut6p+j5walB6MGt7LWo5E8vAyLDTo77b5lJBLYLJSyv9z7Ji0j8kNRhWCASOb+FBMqOAHSLgW5o/xlGeqlkkwEfBUD4jngOpcCJCRBrj3hqDuUUF1Q4+IysMOMB1yXQWWCnXPUL2mmF2F1OpP23Gmrxq3JLn2csPmuAucj4= Received: by 10.35.107.20 with SMTP id j20mr4722041pym.1174068936132; Fri, 16 Mar 2007 11:15:36 -0700 (PDT) Received: from ?192.168.1.14? ( [76.168.243.89]) by mx.google.com with ESMTP id 17sm9771182nzo.2007.03.16.11.15.34; Fri, 16 Mar 2007 11:15:35 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <20070316082824.E97295@turing> References: <635C86FC-5150-4528-972E-A5E99418D0A9@salesdepotinc.com> <1174033677.1588.5.camel@exponent> <43632782-B042-4464-BB36-A76F205B49DD@gmail.com> <3707F016-B450-4E5E-9CA2-DB72FA5A4E70@gmail.com> <20070316082824.E97295@turing> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <43F553E4-A4E1-457C-B82D-4DE94FA02EE3@gmail.com> Content-Transfer-Encoding: 7bit From: Victor Igumnov Date: Fri, 16 Mar 2007 11:16:01 -0700 To: freebsd-java@freebsd.org X-Mailer: Apple Mail (2.752.3) 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 18:15:37 -0000 Update, seems like it is a Locale issue, which is odd I remember specifically setting it before, and it still produced the same error. Well I guess this is user blunder on my part. How would you set the default locale for the JDK? I might just might wrap it around with Spring to set a predefined locale. -Victor On Mar 16, 2007, at 8:34 AM, Nick Johnson wrote: > Surely if it were a bytecode issue, someone else would have been > able to > reproduce it. As it is, I tried code compiled on FreeBSD, Solaris, > Windows and Linux and they all worked fine and exactly as expected > with > the testcase. > > The one thing that did not work was naming a class "Test" with no > package > name, which I would imagine is a legitimate bug. > > Have you tried any of the following: > > * Running your test on another machine > * Recompiling / Reinstalling the diablo JVM > * CVS Updating your ports and rebuilding the diablo JVM out of > ports > > Nick > > On Fri, 16 Mar 2007, Victor Igumnov wrote: > >>> 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" >>>> >>> >> >> _______________________________________________ >> 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" >> > > -- > "Humans are a dangerously insane and very sick species." > -- Eckhart Tolle > This message has been brought to you by Nick Johnson 2.2 and the > number 6. > http://healerNick.com/ http://morons.org/ http:// > spatula.net/