diff options
author | aclement <aclement> | 2006-10-16 09:20:27 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-10-16 09:20:27 +0000 |
commit | 9030415d5741f7d4ac96cd055e860c7760d93d37 (patch) | |
tree | 8ca397ca68c556145d230d477450201885bbd562 /weaver | |
parent | 5b715608033ae06bdcacfeb71397380ff0cf3235 (diff) | |
download | aspectj-9030415d5741f7d4ac96cd055e860c7760d93d37.tar.gz aspectj-9030415d5741f7d4ac96cd055e860c7760d93d37.zip |
moved things around so that Xset can change world configuration
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/World.java | 1 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelWorld.java | 16 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/ltw/LTWWorld.java | 1 |
3 files changed, 14 insertions, 4 deletions
diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index fb5fe193b..da29f249b 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -775,6 +775,7 @@ public abstract class World implements Dump.INode { extraConfiguration.setProperty(n,v); } } + ensureAdvancedConfigurationProcessed(); } /** diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java index 5dfeba271..bee6f126e 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java @@ -85,6 +85,7 @@ public class BcelWorld extends World implements Repository { private ClassPathManager classPath; protected Repository delegate; + private ClassLoader loader; //private ClassPathManager aspectPath = null; @@ -153,15 +154,20 @@ public class BcelWorld extends World implements Repository { */ public BcelWorld(ClassLoader loader, IMessageHandler handler, ICrossReferenceHandler xrefHandler) { this.classPath = null; + this.loader = loader; setMessageHandler(handler); setCrossReferenceHandler(xrefHandler); // Tell BCEL to use us for resolving any classes - delegate = getClassLoaderRepositoryFor(loader); - // TODO Alex do we need to call org.aspectj.apache.bcel.Repository.setRepository(delegate); - // if so, how can that be safe in J2EE ?? (static stuff in Bcel) + // delegate = getClassLoaderRepositoryFor(loader); + } + + public void ensureRepositorySetup() { + if (delegate==null) { + delegate = getClassLoaderRepositoryFor(loader); + } } - public Repository getClassLoaderRepositoryFor(ClassLoader loader) { + public Repository getClassLoaderRepositoryFor(ClassLoader loader) { if (bcelRepositoryCaching) { return new ClassLoaderRepository(loader); } else { @@ -360,6 +366,7 @@ public class BcelWorld extends World implements Repository { private JavaClass lookupJavaClass(ClassPathManager classPath, String name) { if (classPath == null) { try { + ensureRepositorySetup(); JavaClass jc = delegate.loadClass(name); if (trace.isTraceEnabled()) trace.event("lookupJavaClass",this,new Object[] { name, jc }); return jc; @@ -863,4 +870,5 @@ public class BcelWorld extends World implements Repository { decpToRepeat = decpToRepeatNextTime; } } + }
\ No newline at end of file diff --git a/weaver/src/org/aspectj/weaver/ltw/LTWWorld.java b/weaver/src/org/aspectj/weaver/ltw/LTWWorld.java index a89dc6f77..439584ee9 100644 --- a/weaver/src/org/aspectj/weaver/ltw/LTWWorld.java +++ b/weaver/src/org/aspectj/weaver/ltw/LTWWorld.java @@ -246,6 +246,7 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld { } public void storeClass(JavaClass clazz) { + ensureRepositorySetup(); delegate.storeClass(clazz); } |