Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Covariant return types

Hi,
        This joinpoint matches both methods with Covariant return
types properly. Is it possible to match only one ?

Thanks,
Mohan

declare warning: execution(Collection<? extends Test> *.test( .. )) :
"Covariant";

public class CovariantSuper {

	public Collection<? extends Test> test(){
		return null;
	}

	public Class<?> test1(){
		return null;
	}

}

package com.test;

import java.util.Collection;

public class CovariantSub extends CovariantSuper{

	public Collection<Test> test(){
		return null;
	}
	
	@SuppressWarnings("unchecked")          // This is required.
Otherwise I don't see the eclipse marker.
	public Class test1(){
		return null;
	}

}


Back to the top