From 677f7d0c4b42bc9d0a4ad793747e9183e3322f3f Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 26 Apr 2008 05:11:25 +0000 Subject: [PATCH] 228980: tests and partial fix --- .../aspectj/weaver/patterns/ExactTypePattern.java | 14 ++++++++++++-- .../aspectj/weaver/patterns/SignaturePattern.java | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java index 99ff2c352..859e8316f 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java @@ -106,7 +106,12 @@ public class ExactTypePattern extends TypePattern { typeMatch = matchesTypeVariable((TypeVariableReferenceType)matchType); } annotationPattern.resolve(matchType.getWorld()); - boolean annMatch = this.annotationPattern.matches(matchType).alwaysTrue(); + boolean annMatch = false; + if (matchType.temporaryAnnotationTypes!=null) { + annMatch = annotationPattern.matches(matchType,matchType.temporaryAnnotationTypes).alwaysTrue(); + } else { + annMatch = annotationPattern.matches(matchType).alwaysTrue(); + } return (typeMatch && annMatch); } @@ -125,7 +130,12 @@ public class ExactTypePattern extends TypePattern { typeMatch = matchesTypeVariable((TypeVariableReferenceType)matchType); } annotationPattern.resolve(matchType.getWorld()); - boolean annMatch = this.annotationPattern.matches(annotatedType).alwaysTrue(); + boolean annMatch = false; + if (annotatedType.temporaryAnnotationTypes!=null) { + annMatch = annotationPattern.matches(annotatedType,annotatedType.temporaryAnnotationTypes).alwaysTrue(); + } else { + annMatch = annotationPattern.matches(annotatedType).alwaysTrue(); + } return (typeMatch && annMatch); } diff --git a/weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java b/weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java index 061e8b652..813925d24 100644 --- a/weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java @@ -402,7 +402,7 @@ public class SignaturePattern extends PatternNode { if (parameterAnnotationTypes==null || parameterAnnotationTypes.length==0) parameterAnnotationTypes=null; if (!parameterTypes.matches(resolvedParameters, TypePattern.STATIC,parameterAnnotationTypes).alwaysTrue()) { // It could still be a match based on the generic sig parameter types of a parameterized type - if (!parameterTypes.matches(world.resolve(aMethod.getGenericParameterTypes()),TypePattern.STATIC).alwaysTrue()) { + if (!parameterTypes.matches(world.resolve(aMethod.getGenericParameterTypes()),TypePattern.STATIC,parameterAnnotationTypes).alwaysTrue()) { return FuzzyBoolean.MAYBE; // It could STILL be a match based on the erasure of the parameter types?? // to be determined via test cases... -- 2.39.5