]> source.dussan.org Git - aspectj.git/commitdiff
fix for pr113531
authoraclement <aclement>
Fri, 11 Nov 2005 18:10:09 +0000 (18:10 +0000)
committeraclement <aclement>
Fri, 11 Nov 2005 18:10:09 +0000 (18:10 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index d85743bb0376e61ba040f8bdec09ea2e791694ba..4754164f9a423239ba485afc8f40d2657f7080b1 100644 (file)
@@ -67,6 +67,8 @@ import org.aspectj.weaver.IClassFileProvider;
 import org.aspectj.weaver.IWeaveRequestor;
 import org.aspectj.weaver.IWeaver;
 import org.aspectj.weaver.NewParentTypeMunger;
+import org.aspectj.weaver.ReferenceType;
+import org.aspectj.weaver.ReferenceTypeDelegate;
 import org.aspectj.weaver.ResolvedTypeMunger;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.ShadowMunger;
@@ -980,7 +982,7 @@ public class BcelWeaver implements IWeaver {
                 if (theType.isAnnotationStyleAspect()) {
                     BcelObjectType classType = BcelWorld.getBcelObjectType(theType);
                     if (classType==null) {
-                        throw new BCException("Can't find bcel delegate for "+className+" type="+theType.getClass());
+                       throw new BCException("Can't find bcel delegate for "+className+" type="+theType.getClass());
                     }
                     LazyClassGen clazz = classType.getLazyClassGen();
                     BcelPerClauseAspectAdder selfMunger = new BcelPerClauseAspectAdder(theType, theType.getPerClause().getKind());
@@ -1053,8 +1055,16 @@ public class BcelWeaver implements IWeaver {
                        String className = classFile.getClassName();
                        ResolvedType theType = world.resolve(className);
                        if (theType.isAspect()) {
-                               BcelObjectType classType = BcelWorld.getBcelObjectType(theType);
+                          BcelObjectType classType = BcelWorld.getBcelObjectType(theType);
                                if (classType==null) {
+                                       
+                                       // Sometimes.. if the Bcel Delegate couldn't be found then a problem occurred at compile time - on
+                                       // a previous compiler run.  In this case I assert the delegate will still be an EclipseSourceType
+                                       // and we can ignore the problem here (the original compile error will be reported again from
+                                       // the eclipse source type) - pr113531
+                                       ReferenceTypeDelegate theDelegate = ((ReferenceType)theType).getDelegate();
+                                       if (theDelegate.getClass().getSimpleName().equals("EclipseSourceType")) continue;
+
                                        throw new BCException("Can't find bcel delegate for "+className+" type="+theType.getClass());
                                }
                        weaveAndNotify(classFile, classType,requestor);