]> source.dussan.org Git - aspectj.git/commitdiff
278496
authoraclement <aclement>
Thu, 15 Jul 2010 23:23:02 +0000 (23:23 +0000)
committeraclement <aclement>
Thu, 15 Jul 2010 23:23:02 +0000 (23:23 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java

index a78aab81d8353d65e6b260d751ff7dff63422f06..d2e9f0196794fc580fb9fb921c0cce2079652f6a 100644 (file)
@@ -377,8 +377,8 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                List<AjAttribute> l = null;
                try {
                        l = Utility.readAjAttributes(className, javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),
-                                       getResolvedTypeX().getWorld(), AjAttribute.WeaverVersionInfo.UNKNOWN, new BcelConstantPoolReader(javaClass
-                                                       .getConstantPool()));
+                                       getResolvedTypeX().getWorld(), AjAttribute.WeaverVersionInfo.UNKNOWN,
+                                       new BcelConstantPoolReader(javaClass.getConstantPool()));
                } catch (RuntimeException re) {
                        throw new RuntimeException("Problem processing attributes in " + javaClass.getFileName(), re);
                }
@@ -434,8 +434,8 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                        } else if (a instanceof AjAttribute.SourceContextAttribute) {
                                if (getResolvedTypeX().getSourceContext() instanceof SourceContextImpl) {
                                        AjAttribute.SourceContextAttribute sca = (AjAttribute.SourceContextAttribute) a;
-                                       ((SourceContextImpl) getResolvedTypeX().getSourceContext()).configureFromAttribute(sca.getSourceFileName(), sca
-                                                       .getLineBreaks());
+                                       ((SourceContextImpl) getResolvedTypeX().getSourceContext()).configureFromAttribute(sca.getSourceFileName(),
+                                                       sca.getLineBreaks());
 
                                        setSourcefilename(sca.getSourceFileName());
                                }
@@ -985,4 +985,8 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate {
                superTypeReference.clear();
                superInterfaceReferences.clear();
        }
+
+       public boolean isWeavable() {
+               return true;
+       }
 }
index a22974e0f4301830d646b2bf3354c79773f97f87..7cf6f533a420b704f7db99ac1287b662b21226bb 100644 (file)
@@ -64,6 +64,7 @@ import org.aspectj.weaver.CustomMungerFactory;
 import org.aspectj.weaver.IClassFileProvider;
 import org.aspectj.weaver.IUnwovenClassFile;
 import org.aspectj.weaver.IWeaveRequestor;
+import org.aspectj.weaver.MissingResolvedTypeWithKnownSignature;
 import org.aspectj.weaver.NewParentTypeMunger;
 import org.aspectj.weaver.ReferenceType;
 import org.aspectj.weaver.ReferenceTypeDelegate;
@@ -1745,16 +1746,18 @@ public class BcelWeaver {
                                                        }
                                                        // If the compilation unit node contained no other types, there is no need to keep it
                                                        if (!anyOtherTypeDeclarations) {
-                                                               IProgramElement cuParent = parent.getParent();
+                                                               IProgramElement cuParent = compilationUnit.getParent();
                                                                if (cuParent != null) {
-                                                                       cuParent.setParent(null);
-                                                                       cuParent.removeChild(parent);
+                                                                       compilationUnit.setParent(null);
+                                                                       cuParent.removeChild(compilationUnit);
                                                                }
                                                                // need to update some caches and structures too?
                                                                ((AspectJElementHierarchy) model.getHierarchy()).forget(parent, typeElement);
                                                        } else {
                                                                ((AspectJElementHierarchy) model.getHierarchy()).forget(null, typeElement);
                                                        }
+                                               } else {
+                                                       ((AspectJElementHierarchy) model.getHierarchy()).forget(null, typeElement);
                                                }
                                        }
                                }
index 766c3bfa04b8405d01f6f2442ad999dddff503ca..f9579da1790adfc653016ef9ebc875d2f341c92b 100644 (file)
@@ -670,6 +670,7 @@ public class BcelWorld extends World implements Repository {
                // is possible
                classPath.closeArchives();
                typeMap.report();
+               typeMap.demote(true);
                ResolvedType.resetPrimitives();
        }
 
@@ -1175,4 +1176,8 @@ public class BcelWorld extends World implements Repository {
                return typeMap;
        }
 
+       public boolean isLoadtimeWeaving() {
+               return false;
+       }
+
 }