]> source.dussan.org Git - aspectj.git/commitdiff
261150: diagnostics
authoraclement <aclement>
Thu, 15 Jan 2009 17:33:08 +0000 (17:33 +0000)
committeraclement <aclement>
Thu, 15 Jan 2009 17:33:08 +0000 (17:33 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/AbstractReferenceTypeDelegate.java

index 52d0ade355d96a7cbfec69187de4e969d085242c..20e9f799401617641089d26b369f56ea4dd634cf 100644 (file)
@@ -100,7 +100,11 @@ public abstract class AbstractReferenceTypeDelegate implements ReferenceTypeDele
 
        protected GenericSignature.FormalTypeParameter[] getFormalTypeParametersFromOuterClass() {
                List typeParameters = new ArrayList();
-               ReferenceType outer = (ReferenceType) getOuterClass();
+               ResolvedType outerClassType = getOuterClass();
+               if (!(outerClassType instanceof ReferenceType)) {
+                       throw new BCException("Whilst processing type '"+this.resolvedTypeX.getSignature()+"' - cannot cast the outer type to a reference type.  Signature="+outerClassType.getSignature()+" toString()="+outerClassType.toString());
+               }
+               ReferenceType outer = (ReferenceType) outerClassType;
                ReferenceTypeDelegate outerDelegate = outer.getDelegate();
                AbstractReferenceTypeDelegate outerObjectType = (AbstractReferenceTypeDelegate) outerDelegate;
                if (outerObjectType.isNested()) {