From 74b6ab9de6125fb443b46d004edb9dc6cd4b9369 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 4 Jul 2005 14:55:13 +0000 Subject: [PATCH] generics: --- .../src/org/aspectj/weaver/ReferenceType.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/ReferenceType.java b/weaver/src/org/aspectj/weaver/ReferenceType.java index 9ac887cc0..85bd291ef 100644 --- a/weaver/src/org/aspectj/weaver/ReferenceType.java +++ b/weaver/src/org/aspectj/weaver/ReferenceType.java @@ -18,6 +18,15 @@ import java.util.Iterator; import org.aspectj.bridge.ISourceLocation; import org.aspectj.weaver.patterns.PerClause; +/** + * A reference type represents some 'real' type, not a primitive, not an array - but + * a real type, for example java.util.List. Each ReferenceType has a delegate + * that is the underlying artifact - either an eclipse artifact or a + * bcel artifact. If the type represents a raw type (i.e. there is + * a generic form) then the genericType field is set to point to the + * generic type. If it is for a parameterized type then the generic type + * is also set to point to the generic form. + */ public class ReferenceType extends ResolvedTypeX { /** @@ -36,14 +45,12 @@ public class ReferenceType extends ResolvedTypeX { super(signature, world); } - public ReferenceType(ReferenceType genericType,String signature, World world) { - super(signature,world); - this.genericType=genericType; - setDelegate(genericType.getDelegate()); - // TODO asc generics: for non generic types, should we hold a delegate here or just - // delegate to the one on the generic type? it might let us be a little more flexible - // if we do this - changing just the generic type delegate will affect all parameterized - // and raw variants + /** + * Create a reference type for a generic type + */ + public ReferenceType(TypeX genericType, World world) { + super(genericType.getSignature(),world); + genericSignature=genericType.genericSignature; } public final boolean isClass() { @@ -210,5 +217,13 @@ public class ReferenceType extends ResolvedTypeX { public boolean doesNotExposeShadowMungers() { return delegate.doesNotExposeShadowMungers(); } + + public String getDeclaredGenericSignature() { + return delegate.getDeclaredGenericSignature(); + } + + public void setGenericType(ReferenceType rt) { + this.genericType = rt; + } } \ No newline at end of file -- 2.39.5