From: Andy Clement Date: Fri, 6 Apr 2012 03:53:07 +0000 (-0700) Subject: 375777 X-Git-Tag: V1_7_0RC1~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6e1704d3e20367a0b3327a7544417d5a3291ac27;p=aspectj.git 375777 --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java index 2c5e06f02..64f10059e 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java @@ -1371,6 +1371,9 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC ReferenceType rt = (ReferenceType) onType; ReferenceTypeDelegate rtd = rt.getDelegate(); if (rtd instanceof BcelObjectType) { + if (rt.isRawType()) { + rt = (ReferenceType)rt.getGenericType(); + } rt.addParent(parent); // ((BcelObjectType) rtd).addParent(parent); } diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java index 6c9d6e98b..53f3f72a4 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java @@ -993,7 +993,7 @@ public class ReferenceType extends ResolvedType { } @Override - public ResolvedType getGenericType() { + public ReferenceType getGenericType() { if (isGenericType()) { return this; } @@ -1053,6 +1053,11 @@ public class ReferenceType extends ResolvedType { @Override public void addParent(ResolvedType newParent) { + if (this.isRawType()) { + throw new IllegalStateException( + "The raw type should never be accumulating new interfaces, they should be on the generic type. Type is " + + this.getName()); + } if (newParent.isClass()) { newSuperclass = newParent; superclassReference = new WeakReference(null); diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java index 6cf414466..0659dfc1e 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java @@ -2383,7 +2383,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl * * @return */ - public ResolvedType getGenericType() { + public ReferenceType getGenericType() { // if (!(isParameterizedType() || isRawType())) // throw new BCException("The type " + getBaseName() + " is not parameterized or raw - it has no generic type"); return null;