]> source.dussan.org Git - aspectj.git/commitdiff
pass formal name through
authoraclement <aclement>
Tue, 31 May 2011 22:09:48 +0000 (22:09 +0000)
committeraclement <aclement>
Tue, 31 May 2011 22:09:48 +0000 (22:09 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/patterns/AnnotationPointcut.java

index 261e3a48168c60d2dc254c07501c01e4519e5807..44b346e60e8ccc89a5c1c01a865427c14a8ad94a 100644 (file)
@@ -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();