https://issues.apache.org/bugzilla/show_bug.cgi?id=46387
Summary: Ant's javac task cannot compile what plain Sun SDK javac
can
Product: Ant
Version: 1.7.0
Platform: PC
OS/Version: Linux
Status: NEW
Severity: major
Priority: P2
Component: Core tasks
AssignedTo: [email protected]
ReportedBy: [email protected]
To reproduce, use the following source file in source folder "src":
---
package ch.arrenbrecht.eclipsequirks.inference;
import java.util.ArrayList;
import java.util.List;
public class New
{
public static <T, E extends T> List<T> arrayList( E... _elts )
{
final List<T> c = new ArrayList<T>( _elts.length );
for (E e : _elts)
c.add( e );
return c;
}
public static <T, E extends T> List<T> list( E... _elts )
{
return arrayList( _elts );
}
}
---
and the following Ant build.xml:
---
<project name="EclipseQuirks" default="build">
<target name="build">
<javac srcdir="src" destdir="temp/classes">
<include
name="ch/arrenbrecht/eclipsequirks/inference/**" />
</javac>
</target>
</project>
---
Running `ant build` will yield:
---
Buildfile: build.xml
build:
[javac] Compiling 3 source files to /.../temp/classes
[javac] /.../src/ch/arrenbrecht/eclipsequirks/covariant/IBoth.java:3: types
ch.arrenbrecht.eclipsequirks.covariant.ITwo and
ch.arrenbrecht.eclipsequirks.covariant.IOne are incompatible; both define
foo(), but with unrelated return types
[javac] public interface IBoth extends IOne, ITwo
[javac] ^
[javac] 1 error
BUILD FAILED
/.../build.xml:9: Compile failed; see the compiler error output for details.
Total time: 0 seconds
---
But a similar compilation using plain javac succeeds:
---
$ javac -version
javac 1.6.0_0-internal
$ javac \
-d temp/classes \
-classpath temp/classes \
-sourcepath src \
-g:none \
src/ch/arrenbrecht/eclipsequirks/inference/New.java
---
It also succeeds if I add all the jars on the classpath reported by `ant -v
build`.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.