]> source.dussan.org Git - aspectj.git/commitdiff
375777: ClassCastException
authorAndy Clement <andrew.clement@gmail.com>
Tue, 10 Apr 2012 17:46:02 +0000 (10:46 -0700)
committerAndy Clement <andrew.clement@gmail.com>
Tue, 10 Apr 2012 17:46:02 +0000 (10:46 -0700)
org.aspectj.matcher/src/org/aspectj/weaver/World.java

index 91571713bd11142039b8c6621854d8f7cbf3dbe2..e56fecd7f874dc83d1fa84b074cee3db76e798a8 100644 (file)
@@ -567,14 +567,19 @@ public abstract class World implements Dump.INode {
         */
        private ReferenceType resolveGenericWildcardFor(WildcardedUnresolvedType aType) {
                BoundedReferenceType ret = null;
-               // FIXME asc doesnt take account of additional interface bounds (e.g. ?
-               // super R & Serializable - can you do that?)
+               // FIXME asc doesnt take account of additional interface bounds (e.g. ? super R & Serializable - can you do that?)
                if (aType.isExtends()) {
-                       ReferenceType upperBound = (ReferenceType) resolve(aType.getUpperBound());
-                       ret = new BoundedReferenceType(upperBound, true, this);
+                       ResolvedType resolvedUpperBound = resolve(aType.getUpperBound());
+                       if (resolvedUpperBound.isMissing()) {
+                               return getWildcard();
+                       }
+                       ret = new BoundedReferenceType((ReferenceType)resolvedUpperBound, true, this);
                } else if (aType.isSuper()) {
-                       ReferenceType lowerBound = (ReferenceType) resolve(aType.getLowerBound());
-                       ret = new BoundedReferenceType(lowerBound, false, this);
+                       ResolvedType resolvedLowerBound = resolve(aType.getLowerBound());
+                       if (resolvedLowerBound.isMissing()) {
+                               return getWildcard();
+                       }
+                       ret = new BoundedReferenceType((ReferenceType)resolvedLowerBound, false, this);
                } else {
                        // must be ? on its own!
                        ret = getWildcard();