Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Problem with generic aspects

Hello,
I do not know if this is a known bug/limitation or I am doing
something wrong, but I get a runtime exception when I try the
following example:


public abstract aspect GenAsp<T> {
	public abstract T transform(T x);
	T around() : execution(T *(*)) {return transform(proceed());}
}
public aspect IntAsp extends GenAsp<Integer> {
	public Integer transform(Integer x) {return x;} //  identity transformation
}
public class IntAspTest {
	static Integer mylength(String x) {return x.length();}
	public static void main(String[] args) {System.out.println(mylength(""));}
}


The exception I get is:
java.lang.VerifyError: (class: IntAsp, method: transform signature:
(Ljava/lang/Integer;)Ljava/lang/Integer;) Wrong return type in
function
I believe I am using the latest versions of Java (1.6.0_05) and
AspectJ (1.6.0m2).

Kind regards,
Ivar Rummelhoff


Back to the top