Community
Participate
Working Groups
org.aspectj.weaver.BCException at org.aspectj.weaver.bcel.BcelShadow.initializeKindedAnnotationVars(BcelShadow.java:1553) at org.aspectj.weaver.bcel.BcelShadow.getKindedAnnotationVar(BcelShadow.java:995) at org.aspectj.weaver.patterns.AnnotationPointcut.findResidueInternal(AnnotationPointcut.java:196) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:268) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:97) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:268) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:97) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:268) at org.aspectj.weaver.patterns.AndPointcut.findResidueInternal(AndPointcut.java:97) at org.aspectj.weaver.patterns.Pointcut.findResidue(Pointcut.java:268) at org.aspectj.weaver.bcel.BcelAdvice.specializeOn(BcelAdvice.java:132) at org.aspectj.weaver.bcel.BcelShadow.prepareForMungers(BcelShadow.java:313) at org.aspectj.weaver.Shadow.implement(Shadow.java:404) at org.aspectj.weaver.bcel.BcelClassWeaver.implement(BcelClassWeaver.java:2146) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:467) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:102) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1543) at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1494) at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1275) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1097) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(AjCompilerAdapter.java:300) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCompiling(AjCompilerAdapter.java:178) at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$2$f9cc9ca0(CompilerAdapter.aj:70) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:811) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:230) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:156) at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:122) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) trouble in: public class com.ytg.bilette.client.core.providers.DomainContentProvider extends java.lang.Object implements com.ytg.bilette.client.core.providers.IRefreshableStructuredContentProvider: private java.util.HashSet listeners [Signature(Ljava/util/HashSet<Lcom/ytg/bilette/client/core/providers/IDomainObjectChangeListener<TT;>;>;)] private com.ytg.bilette.client.core.providers.DomainContentProvider$State state [Signature(Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State;)] private Class clazz [Signature(Ljava/lang/Class<+Lcom/ytg/bilette/model/GenericDomainObject;>;)] private boolean deletable private java.util.List summaries [Signature(Ljava/util/List<TT;>;)] static Class class$0 public void <init>(Class) org.aspectj.weaver.MethodDeclarationLineNumber: 47:1136 : ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 47) İNVOKESPECİAL java.lang.Object.<init> ()V constructor-execution(void com.ytg.bilette.client.core.providers.DomainContentProvider.<init>(java.lang.Class)) | ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 34) | NEW java.util.HashSet | DUP | İNVOKESPECİAL java.util.HashSet.<init> ()V | PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.listeners Ljava/util/HashSet; | ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 36) | GETSTATİC com.ytg.bilette.client.core.providers.DomainContentProvider$State.NOT_INITIALIZED Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; | PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.state Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; | ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 40) | İCONST_0 | PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.deletable Z | ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 48) | ALOAD_1 // java.lang.Class clazz | PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.clazz Ljava/lang/Class; | ALOAD_1 // java.lang.Class clazz (line 50) | İNVOKEVİRTUAL java.lang.Class.getInterfaces ()[Ljava/lang/Class; | ASTORE_2 | İCONST_0 (line 51) | İSTORE_3 | GOTO L2 | L0: ALOAD_2 // java.lang.Class[] interfaces (line 52) | İLOAD_3 // int i | AALOAD | LDC com.ytg.bilette.model.Deletable | İNVOKEVİRTUAL java.lang.Object.equals (Ljava/lang/Object;)Z | İFEQ L1 | ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 53) | İCONST_1 | PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.deletable Z | GOTO L3 (line 54) | L1: İİNC 3 1 // int i (line 51) | L2: İLOAD_3 // int i | ALOAD_2 // java.lang.Class[] interfaces | ARRAYLENGTH | İF_İCMPLT L0 | L3: RETURN (line 57) constructor-execution(void com.ytg.bilette.client.core.providers.DomainContentProvider.<init>(java.lang.Class)) end public void <init>(Class) public Object[] getElements(Object) org.aspectj.weaver.MethodDeclarationLineNumber: 65:1611 : ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 66) ALOAD_1 // java.lang.Object input İNVOKESPECİAL com.ytg.bilette.client.core.providers.DomainContentProvider.checkInput (Ljava/lang/Object;)Z İSTORE_2 ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 68) İLOAD_2 // boolean includeDeleted İNVOKEVİRTUAL com.ytg.bilette.client.core.providers.DomainContentProvider.getSummaries (Z)Ljava/util/List; İNVOKEİNTERFACE java.util.List.toArray ()[Ljava/lang/Object; ARETURN end public Object[] getElements(Object) private void checkInitialized(boolean) org.aspectj.weaver.MethodDeclarationLineNumber: 71:1759 : GETSTATİC com.ytg.bilette.client.core.providers.DomainContentProvider$State.NOT_INITIALIZED Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; (line 72) ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.state Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; İNVOKEVİRTUAL com.ytg.bilette.client.core.providers.DomainContentProvider$State.equals (Ljava/lang/Object;)Z İFNE L0 GETSTATİC com.ytg.bilette.client.core.providers.DomainContentProvider$State.LIGHT_INITIALIZED Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; (line 73) ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.state Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; İNVOKEVİRTUAL com.ytg.bilette.client.core.providers.DomainContentProvider$State.equals (Ljava/lang/Object;)Z İFEQ L1 İLOAD_1 // boolean includeDeleted İFEQ L1 L0: ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 74) ACONST_NULL ACONST_NULL İLOAD_1 // boolean includeDeleted İNVOKESPECİAL com.ytg.bilette.client.core.providers.DomainContentProvider.getData (Lcom/ytg/bilette/dao/SummaryDAO;Lorg/eclipse/core/runtime/IProgressMonitor;Z)V L1: RETURN (line 75) end private void checkInitialized(boolean) private boolean checkInput(Object) org.aspectj.weaver.MethodDeclarationLineNumber: 83:2060 : ALOAD_1 // java.lang.Object input (line 84) İNSTANCEOF java.lang.Boolean LDC "Input for generic content provider must be Boolean value" (line 85) İNVOKESTATİC org.eclipse.jface.util.Assert.isTrue (ZLjava/lang/String;)Z (line 84) POP ALOAD_1 // java.lang.Object input (line 86) CHECKCAST java.lang.Boolean İNVOKEVİRTUAL java.lang.Boolean.booleanValue ()Z İSTORE_2 ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 87) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.deletable Z İFNE L1 ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 88) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.deletable Z İFNE L0 İLOAD_2 // boolean includeDeleted İFEQ L1 L0: İCONST_0 GOTO L2 L1: İCONST_1 L2: LDC "Nondeletable object yet deleted flag!" (line 89) İNVOKESTATİC org.eclipse.jface.util.Assert.isLegal (ZLjava/lang/String;)Z (line 87) POP İLOAD_2 // boolean includeDeleted (line 91) İRETURN end private boolean checkInput(Object) public void dispose() org.aspectj.weaver.MethodDeclarationLineNumber: 99:2522 : RETURN (line 101) end public void dispose() public void inputChanged(org.eclipse.jface.viewers.Viewer, Object, Object) org.aspectj.weaver.MethodDeclarationLineNumber: 109:2747 : RETURN (line 111) end public void inputChanged(org.eclipse.jface.viewers.Viewer, Object, Object) private void getData(com.ytg.bilette.dao.SummaryDAO, org.eclipse.core.runtime.IProgressMonitor, boolean) org.aspectj.weaver.MethodDeclarationLineNumber: 115:2954 : ALOAD_1 ASTORE 4 ALOAD_2 ASTORE 5 İLOAD_3 İSTORE 6 method-execution(void com.ytg.bilette.client.core.providers.DomainContentProvider.getData(com.ytg.bilette.dao.SummaryDAO, org.eclipse.core.runtime.IProgressMonitor, boolean)) | ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 117) | ALOAD_1 // com.ytg.bilette.dao.SummaryDAO dao | ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this | GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.clazz Ljava/lang/Class; | İLOAD_3 // boolean includeDeleted | İNVOKEİNTERFACE com.ytg.bilette.dao.SummaryDAO.getSummaries (Ljava/lang/Class;Z)Ljava/util/List; | PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.summaries Ljava/util/List; | İLOAD_3 // boolean includeDeleted (line 118) | İFEQ L0 | ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 119) | GETSTATİC com.ytg.bilette.client.core.providers.DomainContentProvider$State.FULL_INITIALIZED Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; | PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.state Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; | GOTO L1 | L0: ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 121) | GETSTATİC com.ytg.bilette.client.core.providers.DomainContentProvider$State.LIGHT_INITIALIZED Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; | PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.state Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; | L1: RETURN (line 122) method-execution(void com.ytg.bilette.client.core.providers.DomainContentProvider.getData(com.ytg.bilette.dao.SummaryDAO, org.eclipse.core.runtime.IProgressMonitor, boolean)) end private void getData(com.ytg.bilette.dao.SummaryDAO, org.eclipse.core.runtime.IProgressMonitor, boolean) public java.util.List getSummaries(boolean) org.aspectj.weaver.MethodDeclarationLineNumber: 128:3308 : ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 129) İLOAD_1 // boolean includeDeleted İNVOKESPECİAL com.ytg.bilette.client.core.providers.DomainContentProvider.checkInitialized (Z)V İLOAD_1 // boolean includeDeleted (line 131) İFNE L0 GETSTATİC com.ytg.bilette.client.core.providers.DomainContentProvider$State.LIGHT_INITIALIZED Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.state Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; İNVOKEVİRTUAL com.ytg.bilette.client.core.providers.DomainContentProvider$State.equals (Ljava/lang/Object;)Z İFEQ L1 L0: ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 132) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.summaries Ljava/util/List; ARETURN L1: ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 134) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.summaries Ljava/util/List; İNVOKEİNTERFACE java.util.List.iterator ()Ljava/util/Iterator; ASTORE_2 NEW java.util.ArrayList (line 135) DUP İNVOKESPECİAL java.util.ArrayList.<init> ()V ASTORE_3 GOTO L3 (line 136) L2: ALOAD_2 // java.util.Iterator i (line 137) İNVOKEİNTERFACE java.util.Iterator.next ()Ljava/lang/Object; CHECKCAST com.ytg.bilette.model.Deletable CHECKCAST com.ytg.bilette.model.Deletable ASTORE 4 ALOAD 4 // com.ytg.bilette.model.Deletable object (line 138) İNVOKEİNTERFACE com.ytg.bilette.model.Deletable.isDeleted ()Z İFNE L3 ALOAD_3 // java.util.ArrayList list (line 139) ALOAD 4 // com.ytg.bilette.model.Deletable object CHECKCAST com.ytg.bilette.model.GenericDomainObject İNVOKEVİRTUAL java.util.ArrayList.add (Ljava/lang/Object;)Z POP L3: ALOAD_2 // java.util.Iterator i (line 136) İNVOKEİNTERFACE java.util.Iterator.hasNext ()Z İFNE L2 ALOAD_3 // java.util.ArrayList list (line 142) ARETURN end public java.util.List getSummaries(boolean) public synchronized void refresh() org.aspectj.weaver.MethodDeclarationLineNumber: 148:3783 : ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 149) GETSTATİC com.ytg.bilette.client.core.providers.DomainContentProvider$State.NOT_INITIALIZED Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; PUTFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.state Lcom/ytg/bilette/client/core/providers/DomainContentProvider$State; İCONST_0 (line 150) İSTORE_1 ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 152) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.deletable Z İFEQ L2 ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 153) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.listeners Ljava/util/HashSet; İNVOKEVİRTUAL java.util.HashSet.iterator ()Ljava/util/Iterator; ASTORE_2 GOTO L1 (line 154) L0: ALOAD_2 // java.util.Iterator i (line 155) İNVOKEİNTERFACE java.util.Iterator.next ()Ljava/lang/Object; CHECKCAST com.ytg.bilette.client.core.providers.IDomainObjectChangeListener ASTORE_3 ALOAD_3 // com.ytg.bilette.client.core.providers.IDomainObjectChangeListener listener (line 156) İNVOKEİNTERFACE com.ytg.bilette.client.core.providers.IDomainObjectChangeListener.isIncludeDeleted ()Z İFEQ L1 İCONST_1 (line 157) İSTORE_1 // boolean includeDeleted GOTO L2 (line 158) L1: ALOAD_2 // java.util.Iterator i (line 154) İNVOKEİNTERFACE java.util.Iterator.hasNext ()Z İFNE L0 L2: ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 163) ACONST_NULL ACONST_NULL İLOAD_1 // boolean includeDeleted İNVOKESPECİAL com.ytg.bilette.client.core.providers.DomainContentProvider.getData (Lcom/ytg/bilette/dao/SummaryDAO;Lorg/eclipse/core/runtime/IProgressMonitor;Z)V ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 165) ACONST_NULL ACONST_NULL İNVOKESPECİAL com.ytg.bilette.client.core.providers.DomainContentProvider.notifyAllListeners (Lcom/ytg/bilette/model/GenericDomainObject;Lcom/ytg/bilette/model/GenericDomainObject;)V RETURN (line 166) end public synchronized void refresh() private synchronized void notifyAllListeners(com.ytg.bilette.model.GenericDomainObject, com.ytg.bilette.model.GenericDomainObject) org.aspectj.weaver.MethodDeclarationLineNumber: 174:4356 : ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 175) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.listeners Ljava/util/HashSet; İNVOKEVİRTUAL java.util.HashSet.iterator ()Ljava/util/Iterator; ASTORE_3 GOTO L2 (line 176) L0: ALOAD_3 // java.util.Iterator i (line 177) İNVOKEİNTERFACE java.util.Iterator.next ()Ljava/lang/Object; CHECKCAST com.ytg.bilette.client.core.providers.IDomainObjectChangeListener ASTORE 4 ALOAD_1 // com.ytg.bilette.model.GenericDomainObject oldObj (line 178) İFNONNULL L1 ALOAD_2 // com.ytg.bilette.model.GenericDomainObject newObj İFNONNULL L1 ALOAD 4 // com.ytg.bilette.client.core.providers.IDomainObjectChangeListener listener (line 179) İNVOKEİNTERFACE com.ytg.bilette.client.core.providers.IDomainObjectChangeListener.fullRefresh ()V GOTO L2 L1: ALOAD 4 // com.ytg.bilette.client.core.providers.IDomainObjectChangeListener listener (line 181) ALOAD_1 // com.ytg.bilette.model.GenericDomainObject oldObj ALOAD_2 // com.ytg.bilette.model.GenericDomainObject newObj İNVOKEİNTERFACE com.ytg.bilette.client.core.providers.IDomainObjectChangeListener.concessionChanged (Lcom/ytg/bilette/model/GenericDomainObject;Lcom/ytg/bilette/model/GenericDomainObject;)V L2: ALOAD_3 // java.util.Iterator i (line 176) İNVOKEİNTERFACE java.util.Iterator.hasNext ()Z İFNE L0 RETURN (line 183) end private synchronized void notifyAllListeners(com.ytg.bilette.model.GenericDomainObject, com.ytg.bilette.model.GenericDomainObject) public synchronized void addListener(com.ytg.bilette.client.core.providers.IDomainObjectChangeListener) org.aspectj.weaver.MethodDeclarationLineNumber: 185:4715 : ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 186) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.listeners Ljava/util/HashSet; ALOAD_1 // com.ytg.bilette.client.core.providers.IDomainObjectChangeListener listener İNVOKEVİRTUAL java.util.HashSet.add (Ljava/lang/Object;)Z POP RETURN (line 187) end public synchronized void addListener(com.ytg.bilette.client.core.providers.IDomainObjectChangeListener) public synchronized void removeListener(com.ytg.bilette.client.core.providers.IDomainObjectChangeListener) org.aspectj.weaver.MethodDeclarationLineNumber: 189:4831 : ALOAD_0 // com.ytg.bilette.client.core.providers.DomainContentProvider this (line 190) GETFİELD com.ytg.bilette.client.core.providers.DomainContentProvider.listeners Ljava/util/HashSet; ALOAD_1 // com.ytg.bilette.client.core.providers.IDomainObjectChangeListener listener İNVOKEVİRTUAL java.util.HashSet.remove (Ljava/lang/Object;)Z POP RETURN (line 191) end public synchronized void removeListener(com.ytg.bilette.client.core.providers.IDomainObjectChangeListener) end public class com.ytg.bilette.client.core.providers.DomainContentProvider when implementing on shadow method-execution(void com.ytg.bilette.client.core.providers.DomainContentProvider.getData(com.ytg.bilette.dao.SummaryDAO, org.eclipse.core.runtime.IProgressMonitor, boolean)) when weaving type com.ytg.bilette.client.core.providers.DomainContentProvider when weaving classes when weaving when batch building BuildConfig[F:\java\Bilette\.metadata\.plugins\org.eclipse.ajdt.core\com.ytg.bilette.client.core.generated.lst] #Files=22
Are you able to supply any more information? what were you doing at the time? are you using Java5? are you using annotations? are you using annotation binding pointcuts? Did it occur on a full build or an incremental compile? (I suspect the 1.2.1 level of AJ that you raised the bug against isnt quite right... I assume you are on AspectJ 5) The line number has 'moved' since the version in which this stack trace is reported (but I know we haven't made recent AJs available in AJDT yet) - but although it has moved it could still be a bug as I haven't knowingly fixed anything in this area.
Yeah sure. Sorry The bug export was so good I couldn't touch it. :) Anyways, I think it is due the fact that that class being tried to be vowen has java 1.5 templates and template was refered in a matched method... The bug occured o n every build triger. A snipped version of the code is here: public class DomainContentProvider<T extends GenericDomainObject> implements IRefreshableStructuredContentProvider<T> { <...> @DAOOperation(clazz = SummaryDAO.class, remove = DAORemoveCondition.ALWAYS) private void getData(SummaryDAO dao, IProgressMonitor monitor, boolean includeDeleted) { summaries = (List<T>) dao.getSummaries(clazz, includeDeleted); if (includeDeleted) state = State.FULL_INITIALIZED; else state = State.LIGHT_INITIALIZED; } <...> }
Problem recreated with this small test program: =======8<======================== import java.lang.annotation.*; interface GDO {} @Retention(RetentionPolicy.RUNTIME) @interface Marker { } class DCP<T extends GDO> { @Marker void getData(){} } aspect X { before(Marker a): execution(* getData(..)) && @annotation(a) { System.err.println(a); } } public class A { public static void main(String[] args) { new DCP().getData(); } } =======8<======================== (thanks for giving me your code snippet to work from) As suspected by the raiser, the combination of generics and annotations is the problem. We start working with the raw type when we should be working with the generic type when discovering the annotations. The fix is when working with a raw or parameterized type, use the generic type to locate annotations. fix committed.