Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 70794 invoked from network); 17 Oct 2006 09:39:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Oct 2006 09:39:11 -0000 Received: (qmail 35581 invoked by uid 500); 17 Oct 2006 09:39:07 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 35553 invoked by uid 500); 17 Oct 2006 09:39:06 -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 35529 invoked by uid 99); 17 Oct 2006 09:39:06 -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 02:39:06 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of peter.kitt.reilly@gmail.com designates 64.233.182.189 as permitted sender) Received: from [64.233.182.189] (HELO nf-out-0910.google.com) (64.233.182.189) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2006 02:39:03 -0700 Received: by nf-out-0910.google.com with SMTP id x29so224323nfb for ; Tue, 17 Oct 2006 02:38:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LJJUTjp0ivfHnDcimpBa6jkHlxsBYrLGi3NpyjIbjcFBXlPbh6u09CRbDSSlp6PEPMzLvfY9ie6PI5OO40F4Z3bTehRrD78S1wriPqdCV5qFiPZgYdXycUhhcS5L+YpRkAp1AgyZnEljheRaRSIs0vHVbvgWjHSoxhhaGEEuwuQ= Received: by 10.49.41.18 with SMTP id t18mr1240966nfj; Tue, 17 Oct 2006 02:38:38 -0700 (PDT) Received: by 10.49.90.10 with HTTP; Tue, 17 Oct 2006 02:38:37 -0700 (PDT) Message-ID: Date: Tue, 17 Oct 2006 10:38:38 +0100 From: "Peter Reilly" To: "Ant Users List" Subject: Re: a problem compiling a Java 5 project with generics In-Reply-To: <7a829e60610170020x3881a8d1rd12c2d8ee64eb6bc@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7a829e60610161722x3843c74mb712231d040b564@mail.gmail.com> <7a829e60610170020x3881a8d1rd12c2d8ee64eb6bc@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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