Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 63745 invoked from network); 13 Jul 2006 22:10:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jul 2006 22:10:28 -0000 Received: (qmail 47809 invoked by uid 500); 13 Jul 2006 22:10:27 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 47681 invoked by uid 500); 13 Jul 2006 22:10:26 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 47663 invoked by uid 99); 13 Jul 2006 22:10:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jul 2006 15:10:25 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of kiddyr@apple.com designates 17.254.13.22 as permitted sender) Received: from [17.254.13.22] (HELO mail-out3.apple.com) (17.254.13.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jul 2006 15:10:24 -0700 Received: from relay5.apple.com (a17-128-113-35.apple.com [17.128.113.35]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id k6DMA4aC005828 for ; Thu, 13 Jul 2006 15:10:04 -0700 (PDT) Received: from [17.219.213.29] (unknown [17.219.213.29]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by relay5.apple.com (Apple SCV relay) with ESMTP id 63DB7324017; Thu, 13 Jul 2006 15:09:43 -0700 (PDT) In-Reply-To: <3B0E7DF9-2CC4-4C09-971B-C85DE27EC48E@apple.com> References: <9C8C213D-9CE7-4ED1-9358-3A5874B74206@apple.com> <57FF9873-3C7B-46EF-A166-87F7E1E05532@SUN.com> <3B0E7DF9-2CC4-4C09-971B-C85DE27EC48E@apple.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: multipart/alternative; boundary=Apple-Mail-10-575255004 Message-Id: <5294A6E5-4A5B-4A82-B8C5-5EA12BF6611A@apple.com> From: Ray Kiddy Subject: Re: BigDecimal incompatibility from 1.5 -> 1.4 Date: Thu, 13 Jul 2006 15:10:30 -0700 To: Derby Discussion X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAA== X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Apple-Mail-10-575255004 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jul 13, 2006, at 11:25 AM, Ray Kiddy wrote: > > On Jul 13, 2006, at 11:01 AM, Craig L Russell wrote: > >> Hi Ray, >> >> This sounds like a bug in the compiler. Have you raised an issue >> with the JDK folks? >> >> Craig >> > > It had not occurred to me to look at this as a bug in the 1.5 > javac. I think I will file that with Sun. I was just thinking that > the 1.4.2 compiler was, you know, done. > > - ray > FYI, it appears that if you use the 1.5 javac AND specify the 1.4 libraries, the compiler does the right thing. In talking to other people, I have been convinced that Sun would say this is correct behavior. To get true 1.4 compatibility, you need "-source 1.4 -target 1.4" and you need to reference the correct -bootclasspath and -extdirs. - ray % /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/ javac -bootclasspath /Users/ray/Library/Java:/Library/Java:/System/ Library/Java:/Network/Library/Java:/System/Library/Frameworks/ JavaVM.framework/Versions/1.4.2/Classes/classes.jar:/System/Library/ Frameworks/JavaVM.framework/Versions/1.4.2/Classes/ui.jar -extdirs / System/Library/Java/Extensions -classpath . -source 1.4 -target 1.4 foo.java % % java -version java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112) Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing) % % % /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/ javap -bootclasspath /Users/ray/Library/Java:/Library/Java:/System/ Library/Java:/Network/Library/Java:/System/Library/Frameworks/ JavaVM.framework/Versions/1.4.2/Classes/classes.jar:/System/Library/ Frameworks/JavaVM.framework/Versions/1.4.2/Classes/ui.jar -extdirs / System/Library/Java/Extensions -classpath . -c foo Compiled from "foo.java" public class foo extends java.lang.Object{ public foo(); Code: 0: aload_0 1: invokespecial #1; //Method java/lang/Object."":()V 4: return public static void main(java.lang.String[]); Code: 0: new #2; //class java/math/BigDecimal 3: dup 4: ldc2_w #3; //double 10.0d 7: invokespecial #5; //Method java/math/BigDecimal."":(D)V 10: astore_1 11: getstatic #6; //Field java/lang/System.out:Ljava/io/ PrintStream; 14: aload_1 15: invokevirtual #7; //Method java/io/PrintStream.println: (Ljava/lang/Object;)V 18: return } % --Apple-Mail-10-575255004 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1
On Jul 13, 2006, = at 11:25 AM, Ray Kiddy wrote:


On Jul = 13, 2006, at 11:01 AM, Craig L Russell wrote:

Hi Ray,

This = sounds like a bug in the compiler. Have you raised an issue with the JDK = folks?

Craig


It had not occurred to me to = look at this as a bug in the 1.5 javac. I think I will file that with = Sun. I was just thinking that the 1.4.2 compiler was, you know, = done.

- ray


FYI, it appears that if you use the 1.5 javac = AND specify the 1.4 libraries, the compiler does the right thing. = In talking to other people, I have been convinced that Sun would say = this is correct behavior.

To get true 1.4 = compatibility, you need "-source 1.4 -target 1.4" and you need to = reference the correct -bootclasspath and -extdirs.

- ray

% = /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/javac = -bootclasspath = /Users/ray/Library/Java:/Library/Java:/System/Library/Java:/Network/Librar= y/Java:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/= classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Cla= sses/ui.jar -extdirs /System/Library/Java/Extensions -classpath . = -source 1.4 -target 1.4 foo.java
%
% java = -version
java version = "1.5.0_06"
Java(TM) 2 Runtime = Environment, Standard Edition (build = 1.5.0_06-112)
Java HotSpot(TM) = Client VM (build 1.5.0_06-64, mixed mode, = sharing)
%
%
% = /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/javap = -bootclasspath = /Users/ray/Library/Java:/Library/Java:/System/Library/Java:/Network/Librar= y/Java:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/= classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Cla= sses/ui.jar -extdirs /System/Library/Java/Extensions -classpath . -c = foo
Compiled from = "foo.java"
public class foo = extends java.lang.Object{
public = foo();
=A0 = Code:
=A0=A0 0:=A0=A0 = aload_0
=A0=A0 1:=A0=A0 = invokespecial=A0=A0 #1; //Method = java/lang/Object."<init>":()V
=A0=A0 4:=A0=A0 return
public static void = main(java.lang.String[]);
=A0 = Code:
=A0=A0 0:=A0=A0 = new=A0 =A0=A0 #2; //class java/math/BigDecimal
=A0=A0 3:=A0=A0 dup
=A0=A0 4:=A0=A0 = ldc2_w=A0 #3; //double 10.0d
=A0=A0 7:=A0=A0 = invokespecial=A0=A0 #5; //Method = java/math/BigDecimal."<init>":(D)V
=A0=A0 10:=A0 astore_1
=A0=A0 11:=A0 = getstatic=A0 =A0 =A0=A0 #6; //Field = java/lang/System.out:Ljava/io/PrintStream;
=A0=A0 14:=A0 aload_1
=A0=A0 15:=A0 = invokevirtual=A0=A0 #7; //Method = java/io/PrintStream.println:(Ljava/lang/Object;)V
=A0=A0 18:=A0 return
}
%

= --Apple-Mail-10-575255004--