From: Andy Clement Date: Tue, 10 Apr 2012 17:46:02 +0000 (-0700) Subject: 375777: ClassCastException X-Git-Tag: V1_7_0RC1~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=45cbaf5e89474b34b9804bf8387d2189a6bc2eb6;p=aspectj.git 375777: ClassCastException --- diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/World.java b/org.aspectj.matcher/src/org/aspectj/weaver/World.java index 91571713b..e56fecd7f 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/World.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/World.java @@ -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();