ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NonySingh <nonysing...@yahoo.com>
Subject Re: Generics code Compile in Eclipse 3.4 , compilation fails in ANT1.7 (JRE 1.6.0_07)
Date Mon, 06 Apr 2009 11:14:54 GMT

Hi

Hey guys why are u polluting the actual query with your own query and
answers. It would be great if you can post this other query and answers into
another thread.

Nony



NonySingh wrote:
> 
> Hi Experts
> 
> I am seeking help from you guys for my below problem.
> 
> I have following classes :
> 
> <H1>Class TestAntError</H1>
> <PRE>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();
> 			
> 			thisSetDS.add(setDS);
> 			
> 		}
> 
> }</PRE>
> 
> 
> 
> <H1>Class SetDS</H1>
> <PRE>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()
> 	{
> 		
> 	}
> }</PRE>
> 
> 
> 
> In Eclipse IT compiles fine with just warnings but when I try to build it
> with ANT Build fails with following error.
> 
> 
> <PRE>TestANtError.java:14: add(SetDS<capture#4 of ?,capture#583 ?>) in
> SetDS<capture#4 of ?,capture#583 ?> cannot 
> be applied to (K)
>     [javac] 			thisSetDS.add(setDS);
>     [javac] 			         ^
>     [javac] 1 error
> </PRE>
> 
> 
> I am not sure whats the problem. 
> 
> Please help.
> 
> Regards
> 
> Nony
> 

-- 
View this message in context: http://www.nabble.com/Generics-code-Compile-in-Eclipse-3.4-%2C-compilation-fails-in-ANT1.7-%28JRE-1.6.0_07%29-tp22903702p22906706.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message