aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2008-01-25 19:06:30 +0000
committeraclement <aclement>2008-01-25 19:06:30 +0000
commitd33ae8fd19e783c8119cc2519589272ba90a802e (patch)
treea328320e4ffbbea20387a0233f201c9f42a7122a /weaver
parentde8f001c29e04cc22e53a1ae17a58e705d271f89 (diff)
downloadaspectj-d33ae8fd19e783c8119cc2519589272ba90a802e.tar.gz
aspectj-d33ae8fd19e783c8119cc2519589272ba90a802e.zip
paramannos: aware of parameter annotation matching
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
index cd8cb3420..61a461e01 100644
--- a/weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
+++ b/weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
@@ -16,8 +16,10 @@ import java.util.Map;
import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.AnnotatedElement;
import org.aspectj.weaver.ISourceContext;
+import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.World;
+import org.aspectj.weaver.AjAttribute.WeaverVersionInfo;
public class NotAnnotationTypePattern extends AnnotationTypePattern {
@@ -35,6 +37,9 @@ public class NotAnnotationTypePattern extends AnnotationTypePattern {
return negatedPattern.matches(annotated).not();
}
+ public FuzzyBoolean matches(AnnotatedElement annotated,ResolvedType[] parameterAnnotations) {
+ return negatedPattern.matches(annotated,parameterAnnotations).not();
+ }
/* (non-Javadoc)
* @see org.aspectj.weaver.patterns.AnnotationTypePattern#resolve(org.aspectj.weaver.World)
*/
@@ -56,6 +61,7 @@ public class NotAnnotationTypePattern extends AnnotationTypePattern {
AnnotationTypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap,w);
NotAnnotationTypePattern ret = new NotAnnotationTypePattern(newNegatedPattern);
ret.copyLocationFrom(this);
+ if (this.isForParameterAnnotationMatch()) ret.setForParameterAnnotationMatch();
return ret;
}
@@ -66,22 +72,27 @@ public class NotAnnotationTypePattern extends AnnotationTypePattern {
s.writeByte(AnnotationTypePattern.NOT);
negatedPattern.write(s);
writeLocation(s);
+ s.writeBoolean(isForParameterAnnotationMatch());
}
public static AnnotationTypePattern read(VersionedDataInputStream s, ISourceContext context) throws IOException {
AnnotationTypePattern ret = new NotAnnotationTypePattern(AnnotationTypePattern.read(s,context));
ret.readLocation(context,s);
+ if (s.getMajorVersion()>=WeaverVersionInfo.WEAVER_VERSION_MINOR_AJ160) {
+ if (s.readBoolean()) ret.setForParameterAnnotationMatch();
+ }
return ret;
}
public boolean equals(Object obj) {
if (!(obj instanceof NotAnnotationTypePattern)) return false;
NotAnnotationTypePattern other = (NotAnnotationTypePattern) obj;
- return other.negatedPattern.equals(negatedPattern);
+ return other.negatedPattern.equals(negatedPattern) && other.isForParameterAnnotationMatch()==isForParameterAnnotationMatch();
}
public int hashCode() {
int result = 17 + 37*negatedPattern.hashCode();
+ result = 37*result +(isForParameterAnnotationMatch()?0:1);
return result;
}
@@ -102,4 +113,8 @@ public class NotAnnotationTypePattern extends AnnotationTypePattern {
negatedPattern.traverse(visitor,ret);
return ret;
}
+
+ public void setForParameterAnnotationMatch() {
+ negatedPattern.setForParameterAnnotationMatch();
+ }
}