From e1e919408d346b7ff985c4920de7ab2d777a9d3c Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 18 May 2006 11:46:57 +0000 Subject: [PATCH] fix for 125480 --- .../weaver/loadtime/ConcreteAspectCodeGen.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java index bb6af4aac..73ac9f3da 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java @@ -170,7 +170,9 @@ public class ConcreteAspectCodeGen { n = n.substring(0,n.indexOf("$")); elligibleAbstractions.add(n); } else { - elligibleAbstractions.add(method.getName()); + // Only interested in abstract methods that take no parameters and are marked @Pointcut + if (hasPointcutAnnotation(method)) + elligibleAbstractions.add(method.getName()); } } else { reportError("Abstract method '" + method.getName() + "' cannot be concretized as a pointcut (illegal signature, must have no arguments, must return void): " + stringify()); @@ -209,6 +211,17 @@ public class ConcreteAspectCodeGen { sb.append("'/> in aop.xml"); return sb.toString(); } + + private boolean hasPointcutAnnotation(ResolvedMember member) { + AnnotationX[] as = member.getAnnotations(); + if (as==null || as.length==0) return false; + for (int i = 0; i < as.length; i++) { + if (as[i].getTypeSignature().equals("Lorg/aspectj/lang/annotation/Pointcut;")) { + return true; + } + } + return false; + } /** * Build the bytecode for the concrete aspect -- 2.39.5