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

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
<project name="Test" default="build">
	
	<target name="build">
		<javac 
			   srcdir="src" 
			   destdir="bin"
			   target="1.5"
			   source="1.5"
			   debug="true">
		</javac>
	</target>
	
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to