]> source.dussan.org Git - aspectj.git/commitdiff
work in progress.... annotation pointcuts, parsing, and patterns
authoracolyer <acolyer>
Mon, 6 Dec 2004 14:08:23 +0000 (14:08 +0000)
committeracolyer <acolyer>
Mon, 6 Dec 2004 14:08:23 +0000 (14:08 +0000)
weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java
weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java

index 5fdac5a2d72b3a2bbd21e5ab8b71355c0d1ab13a..1e34b1404f3cd5d9eec4aa5066bb87beab073b5e 100644 (file)
@@ -83,13 +83,13 @@ public class KindedPointcut extends Pointcut {
                if (shadow.getIWorld().getLint().noJoinpointsForBridgeMethods.isEnabled()) {
                        ResolvedMember rm = shadow.getSignature().resolve(shadow.getIWorld());
                        if (rm!=null) {
-                               int shadowModifiers = shadow.getSignature().getModifiers(shadow.getIWorld());
-                               if (ResolvedTypeX.hasBridgeModifier(shadowModifiers)) {
-                                       shadow.getIWorld().getLint().noJoinpointsForBridgeMethods.signal(new String[]{},getSourceLocation(),
+               int shadowModifiers = shadow.getSignature().getModifiers(shadow.getIWorld());
+                           if (ResolvedTypeX.hasBridgeModifier(shadowModifiers)) {
+                                 shadow.getIWorld().getLint().noJoinpointsForBridgeMethods.signal(new String[]{},getSourceLocation(),
                                                new ISourceLocation[]{shadow.getSourceLocation()});
-                               }
-                       }
-               }
+                           }
+            }
+        }
        }
        
        public FuzzyBoolean match(JoinPoint.StaticPart jpsp) {
@@ -176,7 +176,8 @@ public class KindedPointcut extends Pointcut {
                                TypePattern.ANY,
                                signature.getName(), 
                                signature.getParameterTypes(),
-                               signature.getThrowsPattern());
+                               signature.getThrowsPattern(),
+                               signature.getAnnotationPattern());
 
                if (nonConfusingPattern
                        .matches(shadow.getSignature(), shadow.getIWorld())) {
index d086c857309b006eff88d54f14d3649a4a28bad7..3b8c0ec34a1a6516441dadfa3e07a0e1f0de0151 100644 (file)
@@ -48,11 +48,13 @@ public class SignaturePattern extends PatternNode {
        private NamePattern name;
     private TypePatternList parameterTypes;
     private ThrowsPattern throwsPattern;
+    private AnnotationTypePattern annotationPattern;
        
        public SignaturePattern(Member.Kind kind, ModifiersPattern modifiers,
                                 TypePattern returnType, TypePattern declaringType,
                                 NamePattern name, TypePatternList parameterTypes,
-                                ThrowsPattern throwsPattern) {
+                                ThrowsPattern throwsPattern,
+                                                        AnnotationTypePattern annotationPattern) {
                this.kind = kind;
                this.modifiers = modifiers;
                this.returnType = returnType;
@@ -60,6 +62,7 @@ public class SignaturePattern extends PatternNode {
                this.declaringType = declaringType;
                this.parameterTypes = parameterTypes;
                this.throwsPattern = throwsPattern;
+               this.annotationPattern = annotationPattern;
        }
        
        
@@ -287,7 +290,6 @@ public class SignaturePattern extends PatternNode {
                return false;
        }
        
-       
        public boolean matches(Class declaringClass, java.lang.reflect.Member member) {
            if (kind == Member.ADVICE) return true;
            if (kind == Member.POINTCUT) return false;
@@ -474,6 +476,7 @@ public class SignaturePattern extends PatternNode {
                name.write(s);
                parameterTypes.write(s);
                throwsPattern.write(s);
+               annotationPattern.write(s);
                writeLocation(s);
        }
 
@@ -485,8 +488,9 @@ public class SignaturePattern extends PatternNode {
                NamePattern name = NamePattern.read(s);
                TypePatternList parameterTypes = TypePatternList.read(s, context);
                ThrowsPattern throwsPattern = ThrowsPattern.read(s, context);
+               AnnotationTypePattern annotationPattern = AnnotationTypePattern.read(s,context);
                SignaturePattern ret = new SignaturePattern(kind, modifiers, returnType, declaringType,
-                                       name, parameterTypes, throwsPattern);
+                                       name, parameterTypes, throwsPattern,annotationPattern);
                ret.readLocation(context, s);
                return ret;
        }
@@ -531,5 +535,8 @@ public class SignaturePattern extends PatternNode {
                return false;
        }
        
+       public AnnotationTypePattern getAnnotationPattern() {
+               return annotationPattern;
+       }
 
 }