From 2f79c9e3930464f16b9fbb071ad4c9ffa50d2302 Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 13 Jul 2005 13:04:31 +0000 Subject: [PATCH] beginnings of support for matching against type variables --- .../org/aspectj/weaver/patterns/ExactTypePattern.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java index 54a61825f..454821585 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java @@ -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); -- 2.39.5