]> source.dussan.org Git - aspectj.git/commitdiff
302460: debug
authoraclement <aclement>
Thu, 11 Feb 2010 21:34:12 +0000 (21:34 +0000)
committeraclement <aclement>
Thu, 11 Feb 2010 21:34:12 +0000 (21:34 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java

index 2f1c8d2d838ac89dd5ecc55babd60ec9fdb6ef33..5a455e75b5194dc6806c2d95755c7e401714616e 100644 (file)
@@ -909,6 +909,24 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
                        // out that it was the top most implementor (see pr49657)
                        if (!classGen.getType().isTopmostImplementor(onType)) {
                                ResolvedType rtx = classGen.getType().getTopmostImplementor(onType);
+                               if (rtx == null) {
+                                       // pr302460
+                                       // null means there is something wrong with what we are looking at
+                                       ResolvedType rt = classGen.getType();
+                                       if (rt.isInterface()) {
+                                               ISourceLocation sloc = munger.getSourceLocation();
+                                               classWeaver.getWorld().getMessageHandler().handleMessage(
+                                                               MessageUtil.error("ITD target " + rt.getName()
+                                                                               + " is an interface but has been incorrectly determined to be the topmost implementor of "
+                                                                               + onType.getName() + ". ITD is " + this.getSignature(), sloc));
+                                       }
+                                       if (!onType.isAssignableFrom(rt)) {
+                                               ISourceLocation sloc = munger.getSourceLocation();
+                                               classWeaver.getWorld().getMessageHandler().handleMessage(
+                                                               MessageUtil.error("ITD target " + rt.getName() + " doesn't appear to implement " + onType.getName()
+                                                                               + " why did we consider it the top most implementor? ITD is " + this.getSignature(), sloc));
+                                       }
+                               }
                                if (!rtx.isExposedToWeaver()) {
                                        ISourceLocation sLoc = munger.getSourceLocation();
                                        classWeaver.getWorld().getMessageHandler().handleMessage(