]> source.dussan.org Git - aspectj.git/commitdiff
375777
authorAndy Clement <andrew.clement@gmail.com>
Fri, 6 Apr 2012 03:53:07 +0000 (20:53 -0700)
committerAndy Clement <andrew.clement@gmail.com>
Fri, 6 Apr 2012 03:53:07 +0000 (20:53 -0700)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java

index 2c5e06f020e1f5c2cf4441e59bbd52f56d5ded98..64f10059e80283128426617e6776435649fbfe52 100644 (file)
@@ -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);
                        }
index 6c9d6e98b9abfbcb015774eb5a2ba8fd1dfd0e8c..53f3f72a4f6c3342d12f7a00d26b357f1a8542cc 100644 (file)
@@ -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<ResolvedType>(null);
index 6cf414466eda41cd8bddda4240d5a2557b5342cb..0659dfc1e220e13ae2f5299a23b97a07d2045654 100644 (file)
@@ -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;