From: aclement Date: Thu, 15 Jul 2010 23:23:02 +0000 (+0000) Subject: 278496 X-Git-Tag: V1_6_10RC1~96 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d340d6c25bc00afb117d99c96c554769d1b6d8b2;p=aspectj.git 278496 --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java index a78aab81d..d2e9f0196 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java @@ -377,8 +377,8 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { List 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; + } } diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index a22974e0f..7cf6f533a 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -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); } } } diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java index 766c3bfa0..f9579da17 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java @@ -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; + } + }