[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Identifying join points with generics with @AspectJ style
|
"Invalid absolute type name" kind of says it all. Try java.util.ArrayList instead.
Alexander Kriegisch
Hi guys,I’m getting the message “no match for this type name: ArrayList[Xlint:invalidAbsoluteTypeName]” at @Before declaration.My aspect:@Aspectpublic class Model { @Pointcut("get(ArrayList<String> Component.a)") public void getList() {} @Before("getList()") public void starting(JoinPoint pjp) throws Throwable { System.out.println(pjp); }}My sample codeimport java.util.ArrayList;import org.aspectj.lang.JoinPoint;import org.aspectj.lang.annotation.*;class Component { private ArrayList<String> a = new ArrayList<String>(); public void m() { a.add("hellow"); System.out.println(a); } public static void main(String[] a) { new Component().m(); }}Applying withincode to m() method, AspectJ gives the following join points:get(ArrayList Component.a)call(boolean java.util.ArrayList.add(Object))get(PrintStream java.lang.System.out)get(ArrayList Component.a)call(void java.io.PrintStream.println(Object))[hellow]Note that the join point for ArrayList is identified without generics. But,if I write@Pointcut("get(ArrayList Component.a)")AspectJ shows the same message. How can I intercept the ArrayList?Best regards--View this message in context: http://aspectj.2085585.n4.nabble.com/Identifying-join-points-with-generics-with-AspectJ-style-tp4651074.htmlSent from the AspectJ - users mailing list archive at Nabble.com._______________________________________________aspectj-users mailing listaspectj-users@xxxxxxxxxxxhttps://dev.eclipse.org/mailman/listinfo/aspectj-users
|
Attachment:
smime.p7s
Description: S/MIME cryptographic signature