ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From naveen varma <>
Subject Generics Compiling in Eclipse(3.4) and compilation fails in ANT(1.7). JRE 1.6.0_07
Date Tue, 07 Apr 2009 02:08:34 GMT
Hi All 
I am seeking help from you guys for my below problem. 
I have following classes : 
Class TestAntError 
public class TestANtError {

final protected<K extends SetDS<?, ?>>  void add(final K setDS) throws Exception
		//synchronized final protected<K extends SetDS>  void add(final K setDS) throws Exception
			if(setDS == null) {
				throw new NullPointerException("setDS cannot be null !!");
			K thisSetDS =(K) new SetDS();

Class SetDS 
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

public class SetDS<K extends Set<K>, T extends Comparable<T>> {

	private Map<K, T> vecMap_ = new TreeMap<K, T>();
	final public boolean add(SetDS<K, T> rhs) {
		if(rhs == null) {
			throw new NullPointerException("rhs cannot be null !!");
		return false;
	public SetDS()
In Eclipse it compiles fine with just warnings but when I try to build it with ANT, Build
fails with following error. add(SetDS<capture#4 of ?,capture#583 of ?>) in SetDS<capture#4
of ?,capture#583 of ?> cannot 
be applied to (K)
    [javac] 			thisSetDS.add(setDS);
    [javac] 			         ^
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 1 error
I am not sure whats the problem. 

Please help. 

Regards Nony

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message