From a98d17d36ad7667c9f5c65dc65c62a572b040e17 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 31 May 2011 22:09:48 +0000 Subject: [PATCH] pass formal name through --- .../aspectj/weaver/patterns/AnnotationPointcut.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnnotationPointcut.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnnotationPointcut.java index 261e3a481..44b346e60 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnnotationPointcut.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnnotationPointcut.java @@ -198,10 +198,12 @@ public class AnnotationPointcut extends NameBindingPointcut { protected Test findResidueInternal(Shadow shadow, ExposedState state) { if (annotationTypePattern instanceof BindingAnnotationFieldTypePattern) { if (shadow.getKind() != Shadow.MethodExecution) { - shadow.getIWorld().getMessageHandler().handleMessage( - MessageUtil.error( - "Annotation field binding is only supported at method-execution join points (compiler limitation)", - getSourceLocation())); + shadow.getIWorld() + .getMessageHandler() + .handleMessage( + MessageUtil + .error("Annotation field binding is only supported at method-execution join points (compiler limitation)", + getSourceLocation())); return Literal.TRUE; // exit quickly, error will prevent weaving } BindingAnnotationFieldTypePattern btp = (BindingAnnotationFieldTypePattern) annotationTypePattern; @@ -213,7 +215,7 @@ public class AnnotationPointcut extends NameBindingPointcut { if (var == null) { throw new BCException("Unexpected problem locating annotation at join point '" + shadow + "'"); } - state.set(btp.getFormalIndex(), var.getAccessorForValue(formalType)); + state.set(btp.getFormalIndex(), var.getAccessorForValue(formalType, btp.formalName)); } else if (annotationTypePattern instanceof BindingAnnotationTypePattern) { BindingAnnotationTypePattern btp = (BindingAnnotationTypePattern) annotationTypePattern; UnresolvedType annotationType = btp.getAnnotationType(); -- 2.39.5