From: acolyer Date: Mon, 6 Dec 2004 14:08:23 +0000 (+0000) Subject: work in progress.... annotation pointcuts, parsing, and patterns X-Git-Tag: Root_AspectJ5_Development~198 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=576d19fb9b1b769e28d6dbf13b0b3905487c265e;p=aspectj.git work in progress.... annotation pointcuts, parsing, and patterns --- diff --git a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java index 5fdac5a2d..1e34b1404 100644 --- a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java @@ -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())) { diff --git a/weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java b/weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java index d086c8573..3b8c0ec34 100644 --- a/weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java @@ -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; + } }