]> source.dussan.org Git - aspectj.git/commitdiff
231478: testcode and fix - allow for bounds variation when sub-aspect is parameterizi...
authoraclement <aclement>
Mon, 12 May 2008 01:46:18 +0000 (01:46 +0000)
committeraclement <aclement>
Mon, 12 May 2008 01:46:18 +0000 (01:46 +0000)
weaver/src/org/aspectj/weaver/TypeVariable.java
weaver/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java

index d85d7412daa384966d91cbc9232be9b0495a3ad5..d5045ecd84e2748c7de33bea15ce8d03fc10a86d 100644 (file)
@@ -215,7 +215,20 @@ public class TypeVariable {
        // can match any type in the range of the type variable...
        // XXX what about interfaces?
        private boolean matchingBounds(TypeVariableReferenceType tvrt) {
-               if (tvrt.getUpperBound() != getUpperBound()) return false;
+               if (tvrt.getUpperBound() != getUpperBound()) {
+                       UnresolvedType unresolvedCandidateUpperBound = tvrt.getUpperBound();
+                       UnresolvedType unresolvedThisUpperBound = getUpperBound();
+                       if (unresolvedCandidateUpperBound instanceof ResolvedType && unresolvedThisUpperBound instanceof ResolvedType) {
+                               ResolvedType candidateUpperBound = (ResolvedType)unresolvedCandidateUpperBound;
+                               ResolvedType thisUpperBound = (ResolvedType)unresolvedThisUpperBound;
+                               if (!thisUpperBound.isAssignableFrom(candidateUpperBound)) {
+                                       return false;
+                               }
+                       } else {
+                               // not right, they shouldnt have been unresolved...
+                               return false;
+                       }
+               }
                if (tvrt.hasLowerBound() != (getLowerBound() != null)) return false;
                if (tvrt.hasLowerBound() && tvrt.getLowerBound() != getLowerBound()) return false;
                // either we both have bounds, or neither of us have bounds
@@ -379,6 +392,7 @@ public class TypeVariable {
 
        public String getGenericSignature() {
                return "T"+name+";";
+//             return "T"+getSignature();
        }
        public String getErasureSignature() {
                return getFirstBound().getErasureSignature();
index d398a97af4fa4677badc6c30066de2f005997474..d6486b53233a24f6251e18ba22de5de6c57ecb65 100644 (file)
@@ -37,6 +37,7 @@ public class UnresolvedTypeVariableReferenceType extends UnresolvedType implemen
        public void setTypeVariable(TypeVariable aTypeVariable) {
                this.signature = "T" + aTypeVariable.getName() + ";"; //aTypeVariable.getUpperBound().getSignature();
                this.typeVariable = aTypeVariable;
+               this.typeKind=TypeKind.TYPE_VARIABLE;
        }
        
        public ResolvedType resolve(World world) {