]> source.dussan.org Git - aspectj.git/commitdiff
beginnings of support for matching against type variables
authoracolyer <acolyer>
Wed, 13 Jul 2005 13:04:31 +0000 (13:04 +0000)
committeracolyer <acolyer>
Wed, 13 Jul 2005 13:04:31 +0000 (13:04 +0000)
weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java

index 54a61825f7803d2279136eb0f1b952fc12841c32..4548215859477fba641022f1a7561e09246811af 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.weaver.AjAttribute;
 import org.aspectj.weaver.BCException;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedTypeX;
+import org.aspectj.weaver.TypeVariableReferenceType;
 import org.aspectj.weaver.TypeX;
 import org.aspectj.weaver.VersionedDataInputStream;
 
@@ -99,16 +100,26 @@ public class ExactTypePattern extends TypePattern {
                if (!typeMatch && (matchType.isParameterized() || matchType.isGeneric())) {
                        typeMatch = this.type.equals(matchType.getRawType());
                }
+               if (!typeMatch && matchType.isTypeVariable()) {
+                       typeMatch = matchesTypeVariable((TypeVariableReferenceType)matchType);
+               }
                annotationPattern.resolve(matchType.getWorld());
                boolean annMatch = this.annotationPattern.matches(matchType).alwaysTrue();
                return (typeMatch && annMatch);
        }
        
+       private boolean matchesTypeVariable(TypeVariableReferenceType matchType) {
+               return false;
+       }
+       
        protected boolean matchesExactly(ResolvedTypeX matchType, ResolvedTypeX annotatedType) {
                boolean typeMatch = this.type.equals(matchType);
                if (!typeMatch && (matchType.isParameterized() || matchType.isGeneric())) {
                        typeMatch = this.type.equals(matchType.getRawType());
                }
+               if (!typeMatch && matchType.isTypeVariable()) {
+                       typeMatch = matchesTypeVariable((TypeVariableReferenceType)matchType);
+               }
                annotationPattern.resolve(matchType.getWorld());
                boolean annMatch = this.annotationPattern.matches(annotatedType).alwaysTrue();
                return (typeMatch && annMatch);