From d3e0e124ef2c57a96caf1b04338cb5dff692acab Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 13 Jul 2005 10:13:10 +0000 Subject: [PATCH] teach a typex whether or not it represents a type variable --- .../aspectj/weaver/TypeVariableReferenceType.java | 4 ++++ weaver/src/org/aspectj/weaver/TypeX.java | 3 +++ .../weaver/UnresolvedTypeVariableReferenceType.java | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/weaver/src/org/aspectj/weaver/TypeVariableReferenceType.java b/weaver/src/org/aspectj/weaver/TypeVariableReferenceType.java index 37eed50da..91d6789fc 100644 --- a/weaver/src/org/aspectj/weaver/TypeVariableReferenceType.java +++ b/weaver/src/org/aspectj/weaver/TypeVariableReferenceType.java @@ -41,4 +41,8 @@ public class TypeVariableReferenceType extends BoundedReferenceType { return typeVariable; } + public boolean isTypeVariable() { + return true; + } + } diff --git a/weaver/src/org/aspectj/weaver/TypeX.java b/weaver/src/org/aspectj/weaver/TypeX.java index 7763d1e7a..ef5a947e1 100644 --- a/weaver/src/org/aspectj/weaver/TypeX.java +++ b/weaver/src/org/aspectj/weaver/TypeX.java @@ -483,6 +483,9 @@ public class TypeX implements AnnotatedElement { return typeKind==GENERIC; } + public boolean isTypeVariable() { + return false; + } /** * Returns a TypeX object representing the effective outermost enclosing type diff --git a/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java b/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java index b33b100b8..8c8d03948 100644 --- a/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java +++ b/weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java @@ -40,5 +40,17 @@ public class UnresolvedTypeVariableReferenceType extends TypeX { typeVariable.resolve(world); return new TypeVariableReferenceType(typeVariable,world); } + + public boolean isTypeVariable() { + return true; + } + + public String toString() { + if (typeVariable == null) { + return ""; + } else { + return "T" + typeVariable.getName() + ";"; + } + } } -- 2.39.5