]> source.dussan.org Git - aspectj.git/commitdiff
generics: few bug fixes to ensure typex's know if they represent generics/raws or...
authoraclement <aclement>
Mon, 11 Jul 2005 10:46:30 +0000 (10:46 +0000)
committeraclement <aclement>
Mon, 11 Jul 2005 10:46:30 +0000 (10:46 +0000)
weaver/src/org/aspectj/weaver/ReferenceType.java

index 217c32bb71a59156ba3e490f14dcc0cbd46335a9..f2c160eccf94d93f09d58adaedc8ad617b5c28f2 100644 (file)
@@ -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() {