Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 39753 invoked from network); 17 Oct 2006 21:21:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Oct 2006 21:21:33 -0000 Received: (qmail 69826 invoked by uid 500); 17 Oct 2006 21:21:30 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 69204 invoked by uid 500); 17 Oct 2006 21:21:28 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 69193 invoked by uid 99); 17 Oct 2006 21:21:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2006 14:21:27 -0700 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [206.190.58.150] (HELO web55101.mail.re4.yahoo.com) (206.190.58.150) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 17 Oct 2006 14:21:26 -0700 Received: (qmail 78635 invoked by uid 60001); 17 Oct 2006 21:21:04 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=RVMuGAzYDdrgwHD07DO0iODC5WOsJMrlfOLrvv8uqs7/XJ1LhIB1auXRLZJoFkmmCsSYuprYZQ8U7WJ4N/xMiywGNqDB4YSZePRPQpjUU/eZzH7pS0htey+BgNi2EvV5Q2QIw3rLKuIyC3LWLGXvjJeiVn0uFkfj4F+D3F6G/2k= ; Message-ID: <20061017212104.78633.qmail@web55101.mail.re4.yahoo.com> Received: from [66.10.233.130] by web55101.mail.re4.yahoo.com via HTTP; Tue, 17 Oct 2006 14:21:04 PDT Date: Tue, 17 Oct 2006 14:21:04 -0700 (PDT) From: Matt Benson Subject: Re: AW: a problem compiling a Java 5 project with generics To: Ant Users List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --- Peter Reilly wrote: [SNIP] > > I have just checked the revision history, > since the initial checkin (6 years, 9 months), > has always added > the destination path to the classpath for the javac > command. > > It does not seem to be necessary? but I do not know > if > we can remove it without something failing. > Perhaps we can use (yet another) attribute to javac > to > disable this behaviour. > Isn't that what Gump is (sort of) for? If you drop the change in and it doesn't break THE UNIVERSE on Gump, it's -probably- okay, right? :) -Matt > Peter > > > > > Chavdar > > > > > > On 10/17/06, Chavdar Botev > wrote: > > > I have opened a bug report at > > > > http://issues.apache.org/bugzilla/show_bug.cgi?id=40776. > > > > > > Thanks, > > > Chavdar > > > > > > On 10/17/06, Peter Reilly > wrote: > > > > On 10/17/06, Scot P. Floess > wrote: > > > > > Failed for me using Fedora Core 5, sun JDK > 1.5_08 > > > > > > > > > > I don't think its javac as I was able to do > this: > > > > > > > > > > touch src/test/Test3.java > > > > > javac -d bin -sourcepath src -classpath bin > src/test/Test3.java > > > > > > > > That worked me as well, however I modifed the > build script > > > > to do this: > > > > > > > srcdir="src" > destdir="build/classes" > > > > includeantruntime="no" > > > > debug="yes" fork="yes" > executable="${java.home}/../bin/javac.exe"/> > > > > > > > > and ran ant with -debug to see the exact > command line: > > > > > > > > "c:\program > files\java\jdk1.6.0\jre\..\bin\javac.exe" -d > "C:\Documents > > > > and > Settings\reilly\learning\a\compile\build\classes" > -classpath > > > > "C:\Documents and > Settings\reilly\learning\a\compile\build\classes" > > > > -sourcepath "C:\Documents and > Settings\reilly\learning\a\compile\src" > > > > -target 1.5 -g -source 1.5 "C:\Documents and > > > > > Settings\reilly\learning\a\compile\src\org\test\Test3.java" > > > > > > > > This failed as well. > > > > > > > > I removed the differences one at a time, when > -classpath was removed, > > > > the problem > > > > went away. > > > > > > > > I think that this is a javac problem, but > perhaps ant does not need to set the > > > > classpath attribute when -d is the same as > -classpath ? > > > > > > > > Peter > > > > > > > > > > > > > > Javac seems to find everything > correctly...but the javac task in ant is > > > > > having difficulties. One thing to note is > that the generics referred to > > > > > by the inner classes are defined in terms of > the outer class. > > > > > > > > > > James Abley wrote: > > > > > > Fails for me: > > > > > > > > > > > > Ubuntu Dapper, Ant 1.6.5, Sun JDK 1.5.0_07 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > bash:$ ant -v > > > > > > bash:$ touch test/Test3.java > > > > > > bash:$ ant -v > > > > > > > > > > > > [javac] > /work/ant-test/ant-generics/test/Test3.java > > > > > > [javac] > /work/ant-test/ant-generics/test/Test3.java:8: > > > > > > incompatible types > > > > > > [javac] found : test.Base > > > > > > [javac] required: test.Sub > > > > > > [javac] public Sub p() {return > this.getV();} > > > > > > > > > > > > Is this a javac issue rather than ANT > issue? I can provide more > > > > > > information if required. > > > > > > > > > > > > James > > > > > > > > > > > > Jan.Materne@rzf.fin-nrw.de wrote: > > > > > >> Also no problems .... on WinXP, Ant 1.6.5 > and Java 1.5.0_06-b05. > > > > > >> > > > > > >>> setant 165 > > > > > >> Apache Ant version 1.6.5 compiled on June > 2 2005 > > > > > >> > > > > > >>> setjava 15 > > > > > >> Java(TM) 2 Runtime Environment, Standard > Edition (build 1.5.0_06-b05) > > > > > >> Java HotSpot(TM) Client VM (build > 1.5.0_06-b05, mixed mode, sharing) > > > > > >> > > > > > >>> del test\*.class > > > > > >> > > > > > >>> ant -v > > > > > >> Project base dir set to: > C:\tmp\ant-generics > > > > > >> [javac] build.xml skipped - don't > know how to handle it > > > > > >> [javac] test\Base.java added as > test/Base.class doesn't exist. > > > > > >> [javac] test\Sub.java added as > test/Sub.class doesn't exist. > > > > > >> [javac] test\Test1.java added as > test/Test1.class doesn't exist. > > > > > >> [javac] test\Test2.java added as > test/Test2.class doesn't exist. > > > > > >> [javac] test\Test3.java added as > test/Test3.class doesn't exist. > > > > > >> [javac] Compiling 5 source files to > C:\tmp\ant-generics > > > > > >> [javac] Using modern compiler > > > > > >> [javac] Compilation arguments: > > > > > >> [javac] '-d' > > > > > >> [javac] 'C:\tmp\ant-generics' > > > > > >> [javac] '-classpath' > > > > > >> [javac] ' LOT-OF-LIBS-FROM-ANT ' > > > > > >> [javac] '-sourcepath' > > > > > >> [javac] 'C:\tmp\ant-generics' > > > > > >> [javac] '-g:none' > > > > > >> [javac] > > > > > >> [javac] The ' characters around the > executable and arguments are > > > > > >> [javac] not part of the command. > > > > > >> [javac] Files to be compiled: > > > > > >> [javac] > C:\tmp\ant-generics\test\Base.java > > > > > >> [javac] > C:\tmp\ant-generics\test\Sub.java > > > > > >> [javac] > C:\tmp\ant-generics\test\Test1.java > > > > > >> [javac] > C:\tmp\ant-generics\test\Test2.java > > > > > >> [javac] > C:\tmp\ant-generics\test\Test3.java > > > > > >> BUILD SUCCESSFUL > > > > > >> > > > > > >>> ant -v > > > > > >> NOTHING-TO-COMPILE > > > > > >> > > > > > >>> touch test\Test3.java (using Cygwin) > > > > > >> > > > > > >>> ant -v > > > > > >> Project base dir set to: > C:\tmp\ant-generics > > > > > >> [javac] build.xml skipped - don't > know how to handle it > > > > > >> [javac] test\Base.class skipped - > don't know how to handle it > > > > > >> [javac] test\Base.java omitted as > test/Base.class is up to date. > > > > > >> [javac] test\Sub.class skipped - > don't know how to handle it > > > > > >> [javac] test\Sub.java omitted as > test/Sub.class is up to date. > > > > > >> [javac] test\Test1$Inner1.class > skipped - don't know how to > > > > > >> handle it > > > > > >> [javac] test\Test1.class skipped - > don't know how to handle it > > > > > >> [javac] test\Test1.java omitted as > test/Test1.class is up to date. > > > > > >> [javac] test\Test2$Inner2.class > skipped - don't know how to > > > > > >> handle it > > > > > >> [javac] test\Test2.class skipped - > don't know how to handle it > > > > > >> [javac] test\Test2.java omitted as > test/Test2.class is up to date. > > > > > >> [javac] test\Test3$Inner3.class > skipped - don't know how to > > > > > >> handle it > > > > > >> [javac] test\Test3.class skipped - > don't know how to handle it > > > > > >> [javac] test\Test3.java added as > test/Test3.class is outdated. > > > > > >> [javac] Compiling 1 source file to > C:\tmp\ant-generics > > > > > >> [javac] Using modern compiler > > > > > >> [javac] Compilation arguments: > > > > > >> [javac] '-d' > > > > > >> [javac] 'C:\tmp\ant-generics' > > > > > >> [javac] '-classpath' > > > > > >> [javac] ' LOT-OF-LIBS-FROM-ANT ' > > > > > >> [javac] '-sourcepath' > > > > > >> [javac] 'C:\tmp\ant-generics' > > > > > >> [javac] '-g:none' > > > > > >> [javac] > > > > > >> [javac] The ' characters around the > executable and arguments are > > > > > >> [javac] not part of the command. > > > > > >> [javac] File to be compiled: > > > > > >> [javac] > C:\tmp\ant-generics\test\Test3.java > > > > > >> > > > > > >> BUILD SUCCESSFUL > > > > > >> > > > > > >> > > > > > >> > > > > > >> build.xml: > > > > > >> > > > > > >> > > > > > >> > > > > > >> > > > > > >> > > > > > >> > > > > > >> Jan > > > > > >> > > > > > >> > > > > > >>> -----Urspr�ngliche Nachricht----- > > > > > >>> Von: Peter Reilly > [mailto:peter.kitt.reilly@gmail.com] Gesendet: > > > > > >>> Dienstag, 17. Oktober 2006 16:44 > > > > > >>> An: Ant Users List > > > > > >>> Betreff: Re: a problem compiling a Java > 5 project with generics > > > > > >>> > > > > > >>> On 10/17/06, Jan.Materne@rzf.fin-nrw.de > > > > > > >>> wrote: > > > > > >>>> Works for me with Ant 1.6.5 and > 1.7beta2 and the given java > > > > > >>> sources (with and without the commented > line). > > > > > >>>> > > > > > >>>> includes="**/*.class"/> > > > > > >>>> > > > > > >>>> > > > > > >>> This works by itself, but touch > Test3.java and run again. > > > > > >>> Peter > > > > > >>>> > > > > > >>>> > > > > > >>>> Jan > > > > > >>>> > > > > > >>>>> -----Urspr�ngliche Nachricht----- > > > > > >>>>> Von: Peter Reilly > [mailto:peter.kitt.reilly@gmail.com] > > > > > >>>>> Gesendet: Dienstag, 17. Oktober 2006 > 11:39 > > > > > >>>>> An: Ant Users List > > > > > >>>>> Betreff: Re: a problem compiling a > Java 5 project with generics > > > > > >>>>> > > > > > >>>>> Can you enter a bugzilla report about > this. > > > > > >>>>> It is very strange. > > > > > >>>>> > > > > > >>>>> I tried on the commandline: > > > > > >>>>> > > > > > >>>>> javac -target 1.5 -g -source 1.5 > -sourcepath src -d build\classes > > > > > >>>>> src\org\test\Test3.java > > > > > >>>>> > > > > > >>>>> which works fine - and looks very like > the command used by ant. > > > > > >>>>> > > > > > >>>>> Peter > > > > > >>>>> > > > > > >>>>> > > > > > >>>>> On 10/17/06, Chavdar Botev > wrote: > > > > > >>>>>> Hi > > > > > >>>>>> > > > > > >>>>>> For some reason, the mailing server > included only the first > > > > > >>>>>> attachment. Since this is the fourth > or the fifth time I am > > > > > >>>>> trying to > > > > > >>>>>> send the java files, I give up. I'll > inline them in the message. > > > > > >>>>>> > > > > > >>>>>> // src/test/Base.java > > > > > >>>>>> package test; > > > > > >>>>>> public class Base {} > > > > > >>>>>> > > > > > >>>>>> > > > > > >>>>>> // src/test/Sub.java > > > > > >>>>>> package test; > > > > > >>>>>> public class Sub extends Base {} > > > > > >>>>>> > > > > > >>>>>> // src/test/Test1.java > > > > > >>>>>> package test; > > > > > >>>>>> public class Test1 { > > > > > >>>>>> public class Inner1 { > > > > > >>>>>> protected T v; > > > > > >>>>>> public Inner1(T v) > {this.v = v;} > > > > > >>>>>> public T getV() > {return this.v;} > > > > > >>>>>> } > > > > > >>>>>> public Inner1 getInner(T v) > {return new Inner1(v);} } > > > > > >>>>>> > > > > > >>>>>> // src/test/Test2.java > > > > > >>>>>> package test; > > > > > >>>>>> public class Test2 > extends Test1 { > > > > > >>>>>> public class Inner2 extends > Inner1 { > > > > > >>>>>> public Inner2(T v) > {super(v);} > > > > > >>>>>> //public T getV() > {return this.v;} > > > > > >>>>>> } > > > > > >>>>>> } > > > > > >>>>>> > > > > > >>>>>> // src/test/Test3.java > > > > > >>>>>> package test; > > > > > >>>>>> public class Test3 extends Test2 > { > > > > > >>>>>> public class Inner3 extends > Inner2 { > > > > > >>>>>> public Inner3(Sub v) > {super(v);} > > > > > >>>>>> public Sub p() > {return this.getV();} > > > > > >>>>>> } > > > > > >>>>>> > > > > > >>>>>> public Inner3 g() { > > > > > >>>>>> return new Inner3(new > Sub()); > > > > > >>>>>> } > > > > > >>>>>> } > > > > > >>>>>> > > > > > >>>>>> > > > > > >>>>>> HTH, > > > > > >>>>>> Chavdar > > > > > >>>>>> > > > > > >>>>>> > > > > > >>>>>> On 10/16/06, Petar Tahchiev > wrote: > > > > > >>>>>>> On 17/10/06, Chavdar Botev > wrote: > > > > > >>>>>>>> Hi! > > > > > >>>>>>>> > > > > > >>>>>>>> I've come accross the following > problem trying to > > > > > >>> compile Java > > > > > >>>>>>>> 5 classes with generics using Ant > 1.6.5. I've attached > > > > > >>>>> project with > > > > > >>>>>>>> sample Java classes and a build.xml > file. > > > > > >>>>>>>> > > > > > >>>>>>>> NOTE: Please create a src/test > subdirectory and save the > > > > > >>>>> attached > > > > > >>>>>>>> .java files into it. The mailing > list server gave me a hard > > > > > >>>>>>>> time acepting an email with the > archived project files. :( > > > > > >>>>>>>> > > > > > >>>>>>>> A clean build of the above project > works just fine > > > > > >>> and compiles > > > > > >>>>>>>> without a problem. If after that, I > touch the Test3.java > > > > > >>>>> file the > > > > > >>>>>>>> build fails with the following > error: > > > > > >>>>>>>> > > > > > >>>>>>> [javac] > C:\src\appforge\test\src\test\Test3.java:5: > > > > > >>> incompatible > > > > > >>>>>>> types > > > > > >>>>>>>> [javac] found : test.Base > > > > > >>>>>>>> [javac] required: test.Sub > > > > > >>>>>>>> [javac] public Sub p() {return > this.getV();} [javac] > > > > > >>> ^ [javac] > > > > > >>>>>>>> 1 error > > > > > >>>>>>> > > > > > >>>>>>> I must admit that this behaviour is > really strange. I am > > > > > >>>>> interested > > > > > >>>>>>> in helping you but the problem is > that I didn't receive > > > > > >>> any .java > > > > > >>>>>>> files. Please try to prvide them > again. > > > > > >>>>>>> > > > > > >>>>>>> > > > > > >>>>>>> Initially, I thought that this was a > problem with the Java > > > > > >>>>> compiler. > > > > > >>>>>>>> After touching Test3.java, I tried > running javac manually: > > > > > >>>>>>>> > > > > > >>>>>>>> javac -sourcepath src -d bin -g > -source 1.5 -target 1.5 > > > > > >>>>>>>> src\test\*.java > > > > > >>>>>>>> > > > > > >>>>>>>> It turned out that with the above > command-line the project > > > > > >>>>>>>> compiled OK. The project also > compiles without a problem > > > > > >>>>> in Eclipse 3.2.1. > > > > > >>>>>>>> Am I missing anything? It is my > understanding that the > > > > > >>>>> build file > > > > > >>>>>>>> and the command line should produce > the same results. > > > > > >>>>>>>> > > > > > >>>>>>>> Upon further experimentation, if I > uncomment the method in > > > > > >>>>>>>> Test2.java fixes the problem. > Touching Test3.java does > > > > > >>>>> not break the build. > > > > > >>>>>>>> Thanks, > > > > > >>>>>>>> Chavdar > > > > > >>>>>>>> > > > > > >>>>>>>> > > > > > >>>>>>>> > > > > > >>>>> > ------------------------------------------------------------------ > > > > > >>>>>>>> --- To unsubscribe, e-mail: > > > > > >>> user-unsubscribe@ant.apache.org For > > > > > >>>>>>>> additional commands, e-mail: > user-help@ant.apache.org > > > > > >>>>>>>> > > > > > >>>>>>>> > > > > > >>>>>>>> > > > > > >>>>>>> > > > > > >>>>>>> -- > > > > > >>>>>>> Regards, Petar! > > > > > >>>>>>> Karlovo, Bulgaria. > > > > > >>>>>>> > > > > > >>>>>>> > > > > > >>>>>> > > > > > >>> > ------------------------------------------------------------------- > > > > > >>>>>> -- To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org For > > > > > >>>>> additional > > > > > >>>>>> commands, e-mail: > user-help@ant.apache.org > > > > > >>>>>> > > > > > >>>>>> > > > > > >>>> > --------------------------------------------------------------------- > > > > > >>>>> To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org For > > > > > >>>>> additional commands, e-mail: > user-help@ant.apache.org > > > > > >>>>> > > > > > >>>>> > > > > > >>>> > --------------------------------------------------------------------- > > > > > >>>> To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org For > > > > > >>> additional > > > > > >>>> commands, e-mail: > user-help@ant.apache.org > > > > > >>>> > > > > > >>>> > > > > > >>> > --------------------------------------------------------------------- > > > > > >>> To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org For > > > > > >>> additional commands, e-mail: > user-help@ant.apache.org > > > > > >>> > > > > > >>> > > > > > >> > > > > > >> > --------------------------------------------------------------------- > > > > > >> To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org > > > > > >> For additional commands, e-mail: > user-help@ant.apache.org > > > > > >> > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org > > > > > > For additional commands, e-mail: > user-help@ant.apache.org > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Scot P. Floess > > > > > 27 Lake Royale > > > > > Louisburg, NC 27549 > > > > > > > > > > 252-478-8087 (Home) > > > > > 919-754-4592 (Work) > > > > > > > > > > Chief Architect JPlate > http://sourceforge.net/projects/jplate > > > > > Chief Architect JavaPIM > http://sourceforge.net/projects/javapim > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org > > > > > For additional commands, e-mail: > user-help@ant.apache.org > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org > > > > For additional commands, e-mail: > user-help@ant.apache.org > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org > > For additional commands, e-mail: > user-help@ant.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > user-unsubscribe@ant.apache.org > For additional commands, e-mail: > user-help@ant.apache.org > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org