]> source.dussan.org Git - aspectj.git/commitdiff
231396: refactoring AspectJ: tidying up
authoraclement <aclement>
Wed, 4 Jun 2008 19:20:07 +0000 (19:20 +0000)
committeraclement <aclement>
Wed, 4 Jun 2008 19:20:07 +0000 (19:20 +0000)
weaver/src/org/aspectj/weaver/BoundedReferenceType.java
weaver/src/org/aspectj/weaver/ResolvedType.java
weaver/src/org/aspectj/weaver/UnresolvedType.java

index e956653ec7fddc29b94eecb047fbfc167127a53f..75239764e449377b25d70064b0c1aa0723b802d4 100644 (file)
@@ -28,9 +28,9 @@ import org.aspectj.weaver.patterns.PerClause;
  */
 public class BoundedReferenceType extends ReferenceType {
 
-    private UnresolvedType lowerBound;
+    private ResolvedType lowerBound;
 
-    private UnresolvedType upperBound;
+    private ResolvedType upperBound;
 
     protected ReferenceType[] additionalInterfaceBounds = new ReferenceType[0];
 
index c1e5f76643f054bcef0b3ecd63576478e71f57d1..f8a25bc597430e6e93d9690ecf9f75c5027e80e6 100644 (file)
@@ -2147,7 +2147,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                                boolean b = false;
                                                UnresolvedType upperBound = boundedRT.getUpperBound();
                                                if (upperBound.isParameterizedType()) {
-                                                       b = upperBound.isParameterizedWithAMemberTypeVariable();
+                                                       b = ((ResolvedType)upperBound).isParameterizedWithAMemberTypeVariable();
                                                } else if (upperBound.isTypeVariableReference() && ((TypeVariableReference)upperBound).getTypeVariable().getDeclaringElementKind()==TypeVariable.METHOD) {
                                                        b = true;
                                                }
@@ -2161,7 +2161,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                                boolean b = false;
                                                UnresolvedType lowerBound = boundedRT.getLowerBound();
                                                if (lowerBound.isParameterizedType()) {
-                                                       b = lowerBound.isParameterizedWithAMemberTypeVariable();
+                                                       b = ((ResolvedType)lowerBound).isParameterizedWithAMemberTypeVariable();
                                                } else if (lowerBound.isTypeVariableReference() && ((TypeVariableReference)lowerBound).getTypeVariable().getDeclaringElementKind()==TypeVariable.METHOD) {
                                                        b = true;
                                                }
index 79d6aa47158ab2db96aa0179f3c02a62ed20dcba..b32f54da9d7e7b4f500e79b22104d80c9ad79973 100644 (file)
@@ -147,25 +147,10 @@ public class UnresolvedType implements Unresolved, Traceable, TypeVariableDeclar
         * Iff isParameterized(), then these are the type variables bound as parameters
         * in the type 
         */
+       // OPTIMIZE should be no state in here that will damage whether equals() is correct...
        protected TypeVariable[] typeVariables;
 
        
-   /**
-     * Determines if this represents a primitive type.  A primitive type
-     * is one of nine predefined resolved types.
-     *
-     * @return true iff this type represents a primitive type
-     *
-     * @see     ResolvedType#Boolean
-     * @see     ResolvedType#Character
-     * @see     ResolvedType#Byte
-     * @see     ResolvedType#Short
-     * @see     ResolvedType#Integer
-     * @see     ResolvedType#Long
-     * @see     ResolvedType#Float
-     * @see     ResolvedType#Double
-     * @see     ResolvedType#Void
-     */   
     public boolean isPrimitiveType()          { return typeKind == TypeKind.PRIMITIVE; }
     public boolean isSimpleType()             { return typeKind == TypeKind.SIMPLE; }
     public boolean isRawType()                { return typeKind == TypeKind.RAW; }
@@ -197,18 +182,8 @@ public class UnresolvedType implements Unresolved, Traceable, TypeVariableDeclar
         return signature.hashCode();
     }
     
-    /**
-     * Return a version of this parameterized type in which any type parameters
-     * that are type variable references are replaced by their matching type variable
-     * binding.
-     */
-    // OPTIMIZE methods like this just allow callers to be lazy and not ensure they are working with the right (resolved) subtype
-    public UnresolvedType parameterize(Map typeBindings) {
-       throw new UnsupportedOperationException("unable to parameterize unresolved type: " + signature);
-    }
     
     protected UnresolvedType(String signature) {
-        super();
         this.signature = signature;
         this.signatureErasure = signature;
     }
@@ -506,10 +481,6 @@ public class UnresolvedType implements Unresolved, Traceable, TypeVariableDeclar
     }
        
        
-//     public String getParameterizedSignature() {
-//             return signature;
-//     }
-       
        /**
         * For parameterized types, return the signature for the raw type
         */
@@ -822,16 +793,6 @@ public class UnresolvedType implements Unresolved, Traceable, TypeVariableDeclar
                private final String type;
        }
        
-       /**
-        * Will return true if the type being represented is parameterized with a type variable
-        * from a generic method/ctor rather than a type variable from a generic type.  
-        * Only subclasses know the answer...
-        */
-       // OPTIMIZE don't allow this to be called, the caller must have a resolved entity
-       public boolean isParameterizedWithAMemberTypeVariable() {
-               throw new RuntimeException("I dont know - you should ask a resolved version of me: "+this);
-       }
-       
        public TypeVariable getTypeVariableNamed(String name) {
                TypeVariable[] vars = getTypeVariables();
                if (vars==null || vars.length==0) return null;
@@ -846,5 +807,14 @@ public class UnresolvedType implements Unresolved, Traceable, TypeVariableDeclar
                return getClass().getName() + "[" + getName() + "]";
        }
        
+    /**
+     * Return a version of this parameterized type in which any type parameters
+     * that are type variable references are replaced by their matching type variable
+     * binding.
+     */
+    // OPTIMIZE methods like this just allow callers to be lazy and not ensure they are working with the right (resolved) subtype
+    public UnresolvedType parameterize(Map typeBindings) {
+       throw new UnsupportedOperationException("unable to parameterize unresolved type: " + signature);
+    }
 }