From: aclement Date: Mon, 11 Jul 2005 10:46:30 +0000 (+0000) Subject: generics: few bug fixes to ensure typex's know if they represent generics/raws or... X-Git-Tag: PRE_ANDY~43 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c7f2d49d5b8b3b5c62ae53fd89287bff9ea8cb7f;p=aspectj.git generics: few bug fixes to ensure typex's know if they represent generics/raws or simples. --- diff --git a/weaver/src/org/aspectj/weaver/ReferenceType.java b/weaver/src/org/aspectj/weaver/ReferenceType.java index 217c32bb7..f2c160ecc 100644 --- a/weaver/src/org/aspectj/weaver/ReferenceType.java +++ b/weaver/src/org/aspectj/weaver/ReferenceType.java @@ -39,6 +39,13 @@ public class ReferenceType extends ResolvedTypeX { ISourceContext sourceContext = null; int startPos = 0; int endPos = 0; + + public static ReferenceType fromTypeX(TypeX tx, World world) { + ReferenceType rt = new ReferenceType(tx.getRawTypeSignature(),world); + rt.typeKind = tx.typeKind; + return rt; + } + // cached values for members ResolvedMember[] parameterizedMethods = null; @@ -57,6 +64,7 @@ public class ReferenceType extends ResolvedTypeX { public ReferenceType(TypeX genericType, World world) { super(genericType.getSignature(),world); genericSignature=genericType.genericSignature; + typeKind=GENERIC; } public final boolean isClass() { @@ -290,7 +298,13 @@ public class ReferenceType extends ResolvedTypeX { } public void setGenericType(ReferenceType rt) { - this.genericType = rt; + genericType = rt; + // Should we 'promote' this reference type from simple to raw? + // makes sense if someone is specifying that it has a generic form + if ( typeKind == TypeX.SIMPLE ) { + typeKind = TypeX.RAW; + rawTypeSignature = signature; + } } public ResolvedTypeX getGenericType() {