summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-12-10 11:27:26 +0000
committeracolyer <acolyer>2004-12-10 11:27:26 +0000
commitb06338f1b60de75f7b38810be5652a363c63788b (patch)
treea784eadbb9abe2b87f785451da4790fdf07d7d6f
parent9380b983d27b392777788c754cfdc27691d52032 (diff)
downloadaspectj-b06338f1b60de75f7b38810be5652a363c63788b.tar.gz
aspectj-b06338f1b60de75f7b38810be5652a363c63788b.zip
final(?) @args fixes
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/AnnotationPatternList.java4
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/AnnotationPatternList.java b/weaver/src/org/aspectj/weaver/patterns/AnnotationPatternList.java
index daca99502..a5e8cc4cd 100644
--- a/weaver/src/org/aspectj/weaver/patterns/AnnotationPatternList.java
+++ b/weaver/src/org/aspectj/weaver/patterns/AnnotationPatternList.java
@@ -61,7 +61,7 @@ public class AnnotationPatternList extends PatternNode {
public FuzzyBoolean matches(ResolvedTypeX[] someArgs) {
// do some quick length tests first
- int numArgsMatchedByEllipsis = (someArgs.length + ellipsisCount) - typePatterns.length;
+ int numArgsMatchedByEllipsis = (someArgs.length + ellipsisCount) - typePatterns.length;
if (numArgsMatchedByEllipsis < 0) return FuzzyBoolean.NO;
if ((numArgsMatchedByEllipsis > 0) && (ellipsisCount == 0)) {
return FuzzyBoolean.NO;
@@ -81,7 +81,7 @@ public class AnnotationPatternList extends PatternNode {
ExactAnnotationTypePattern ap = (ExactAnnotationTypePattern)typePatterns[i];
FuzzyBoolean matches = ap.matches(someArgs[argsIndex]);
if (matches == FuzzyBoolean.NO) {
- return FuzzyBoolean.NO;
+ return FuzzyBoolean.MAYBE; // could still match at runtime
} else {
argsIndex++;
ret = ret.and(matches);
diff --git a/weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java b/weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java
index 66d771c14..363e27928 100644
--- a/weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java
+++ b/weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java
@@ -119,7 +119,7 @@ public class ArgsAnnotationPointcut extends NameBindingPointcut {
// match the argument type at argsIndex with the ExactAnnotationTypePattern
// we know it is exact because nothing else is allowed in args
ExactAnnotationTypePattern ap = (ExactAnnotationTypePattern)arguments.get(i);
- TypeX argType = shadow.getArgType(i);
+ TypeX argType = shadow.getArgType(argsIndex);
ResolvedTypeX rArgType = argType.resolve(shadow.getIWorld());
if (rArgType == ResolvedTypeX.MISSING) {
IMessage msg = new Message(
@@ -127,12 +127,14 @@ public class ArgsAnnotationPointcut extends NameBindingPointcut {
"",IMessage.ERROR,shadow.getSourceLocation(),null,new ISourceLocation[]{getSourceLocation()});
}
if (ap.matches(rArgType).alwaysTrue()) {
+ argsIndex++;
continue;
} else {
// we need a test...
// TODO: binding
ResolvedTypeX rAnnType = ap.annotationType.resolve(shadow.getIWorld());
- ret = Test.makeAnd(ret,Test.makeHasAnnotation(shadow.getArgVar(i),rAnnType));
+ ret = Test.makeAnd(ret,Test.makeHasAnnotation(shadow.getArgVar(argsIndex),rAnnType));
+ argsIndex++;
}
}
}