aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/ajc153.xml2
-rw-r--r--weaver/src/org/aspectj/weaver/World.java1
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelWorld.java16
-rw-r--r--weaver/src/org/aspectj/weaver/ltw/LTWWorld.java1
4 files changed, 15 insertions, 5 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
index 27b7effc1..b428413d6 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
+++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
@@ -131,8 +131,8 @@
<line text="info AspectJ Weaver Version"/>
<line text="info register classloader"/>
<line text="info using"/>
- <line text="info register aspect"/>
<line text="info [bcelRepositoryCaching=false] AspectJ will not"/>
+ <line text="info register aspect"/>
<line text="info processing"/>
<line text="info successfully"/>
</stderr>
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);
}