From 6e1704d3e20367a0b3327a7544417d5a3291ac27 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Thu, 5 Apr 2012 20:53:07 -0700 Subject: [PATCH] 375777 --- .../ajdt/internal/compiler/lookup/AjLookupEnvironment.java | 3 +++ .../src/org/aspectj/weaver/ReferenceType.java | 7 ++++++- .../src/org/aspectj/weaver/ResolvedType.java | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) 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; -- 2.39.5