From 5622679b2f8e757b3cccd7f92841a0ecd481e50b Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 1 Feb 2005 09:19:53 +0000 Subject: [PATCH] Use the correct 'subject' at the join point for matching --- .../weaver/patterns/AnnotationPointcut.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java b/weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java index 2de0e2228..8ea4fac0c 100644 --- a/weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java @@ -105,9 +105,9 @@ public class AnnotationPointcut extends NameBindingPointcut { Shadow.Kind kind = shadow.getKind(); if (kind == Shadow.StaticInitialization) { - toMatchAgainst = rMember.getType(); + toMatchAgainst = rMember.getDeclaringType().resolve(shadow.getIWorld()); } else if ( (kind == Shadow.ExceptionHandler)) { - toMatchAgainst = TypeX.forName(rMember.getSignature()).resolve(shadow.getIWorld()); + toMatchAgainst = rMember.getParameterTypes()[0].resolve(shadow.getIWorld()); } else { toMatchAgainst = rMember; } @@ -149,7 +149,17 @@ public class AnnotationPointcut extends NameBindingPointcut { protected Test findResidueInternal(Shadow shadow, ExposedState state) { if (shadow.getKind()!=Shadow.MethodCall && - shadow.getKind()!=Shadow.MethodExecution) { + shadow.getKind()!=Shadow.ConstructorCall && + shadow.getKind()!=Shadow.ConstructorExecution && + shadow.getKind()!=Shadow.MethodExecution && + shadow.getKind()!=Shadow.FieldSet && + shadow.getKind()!=Shadow.FieldGet && + shadow.getKind()!=Shadow.StaticInitialization && + shadow.getKind()!=Shadow.PreInitialization && + shadow.getKind()!=Shadow.AdviceExecution && + shadow.getKind()!=Shadow.Initialization && + shadow.getKind()!=Shadow.ExceptionHandler + ) { IMessage lim = MessageUtil.error("Binding not supported in @pcds (1.5.0 M2 limitation) for "+shadow.getKind()+" join points, see: " + getSourceLocation()); shadow.getIWorld().getMessageHandler().handleMessage(lim); -- 2.39.5