diff options
author | acolyer <acolyer> | 2004-12-06 14:08:23 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-12-06 14:08:23 +0000 |
commit | 576d19fb9b1b769e28d6dbf13b0b3905487c265e (patch) | |
tree | 0aa1c593e995424170cc47a47af1256eb6da5459 /weaver | |
parent | a0d450944630dbc637ed841cf33eecbdebe2a3d2 (diff) | |
download | aspectj-576d19fb9b1b769e28d6dbf13b0b3905487c265e.tar.gz aspectj-576d19fb9b1b769e28d6dbf13b0b3905487c265e.zip |
work in progress.... annotation pointcuts, parsing, and patterns
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java | 15 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java | 13 |
2 files changed, 18 insertions, 10 deletions
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; + } } |