From nobody@FreeBSD.org  Thu Mar 15 22:17:57 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id DB3B816A405
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Mar 2007 22:17:57 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id B5D6B13C480
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Mar 2007 22:17:57 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2FMHvlc083452
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Mar 2007 22:17:57 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l2FMHvMN083450;
	Thu, 15 Mar 2007 22:17:57 GMT
	(envelope-from nobody)
Message-Id: <200703152217.l2FMHvMN083450@www.freebsd.org>
Date: Thu, 15 Mar 2007 22:17:57 GMT
From: Victor Igumnov<victori@salesdepotinc.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Diablo jvm bytecode issue
X-Send-Pr-Version: www-3.0

>Number:         110364
>Category:       java
>Synopsis:       Diablo jvm bytecode issue
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-java
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 15 22:20:02 GMT 2007
>Closed-Date:    Sat Mar 17 18:16:21 GMT 2007
>Last-Modified:  Sat Mar 17 18:16:21 GMT 2007
>Originator:     Victor Igumnov
>Release:        6.2
>Organization:
salesdepotinc.com
>Environment:
FreeBSD absolute.salesdepotinc.com 6.2-STABLE FreeBSD 6.2-STABLE #2: Wed Feb 21 18:24:49 PST 2007     root@absolute.salesdepotinc.com:/usr/src/sys/i386/compile/ABSOLUTE  i386
>Description:
I tried to submit this in 10 different ways, all being rejected by the freebsd mailing server. Three different email addresses, all being rejected. Reverse DNS is working yet for some reason it rejected all three. So here is the report.

Bytecode incompatability with the sun classes in Diablo JVM  

 1.
      It seems like this issue is with NumberFormat at the bytecode level
   2.
       
   3.
      Here is an example testcase:
   4.
       
   5.
      import java.text.*;
   6.
       
   7.
      public class Test {
   8.
         public static void main(String[] args) {
   9.
          try {
  10.
           System.out.println(NumberFormat.getCurrencyInstance().parse("$1.99").doubleValue());
  11.
          } catch (Exception e) {
  12.
           e.printStackTrace();
  13.
          }
  14.
         }
  15.
      }
  16.
       
  17.
      Save as Test.java ; compile under the SUN JVM:  javac Test.java
  18.
       
  19.
       
  20.
      Run the class under the Diablo jvm and you will receive
  21.
       
  22.
      -bash-2.05b$ java Test
  23.
      java.text.ParseException: Unparseable number: "$1.99"
  24.
              at java.text.NumberFormat.parse(NumberFormat.java:309)
  25.
              at Test.main(Test.java:6)
  26.
       
  27.
      And when I run it with the SUN JDK
  28.
       
  29.
      absolute# /usr/local/linux-sun-jdk1.5.0/bin/java Test
  30.
      1.99
  31.
       
  32.
       
  33.
      If you can't compile Ill provide what I have,
  34.
       
  35.
      http://salesdepotinc.com/Test.java
  36.
      http://salesdepotinc.com/Test.class  (compiled with sun jdk)
  37.
       
  38.
       
  39.
       
  40.
      Works correctly. 
>How-To-Repeat:
see above
>Fix:
see above
>Release-Note:
>Audit-Trail:

From: Nick Johnson <freebsd@spatula.net>
To: "victori@salesdepotinc.com" <victori@salesdepotinc.com>
Cc: freebsd-java@freebsd.org, FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: java/110364
Date: Thu, 15 Mar 2007 18:01:05 -0700 (PDT)

 I actually get a completely different reaction, not a ParseException:
 
 /usr/ports/java/jdk15/work/control/build/bsd-i586/bin/java Test
 Exception in thread "main" java.lang.NoClassDefFoundError: UnhappyClass
         at Test.main(Test.java:5)
 
 To make matters weirder, if I call my file on FreeBSD Test.java, the same 
 thing happens.
 
 But if I call my file test.java (all lowercase), which produces a class 
 called test.class it works.
 
 If I call my test file FooBar.java, or TesT.java that is fine as well.  It 
 looks like "Test" with no package name is a name you cannot use with 
 diablo JDK.  That's a different bug entirely.
 
 Incidentally, if I call the class "FooBar" and compile on Windows and run 
 it on FreeBSD, that also works fine.  It prints $1.99, just as it should.  
 The same is true for code compiled on Linux.  And Solaris.  I cannot 
 reproduce this problem using the Diablo JDK built out of ports as of 
 January 28, 2007.
 
    Nick
 
 
 On Thu, 15 Mar 2007, 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"
 > 
 
 -- 
 "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/
State-Changed-From-To: open->closed 
State-Changed-By: glewis 
State-Changed-When: Sat Mar 17 18:15:52 UTC 2007 
State-Changed-Why:  
Not a JVM issue, a locale issue, as discussed on freebsd-java. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110364 
>Unformatted:
