diff options
author | aclement <aclement> | 2008-05-27 18:52:24 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-05-27 18:52:24 +0000 |
commit | 56e0a03e4cb6030fe980c546891214d557070bbd (patch) | |
tree | bd64d7cc9e4fe10255f702afdc7e3815ee3483ee /weaver | |
parent | 3bd8068e4463ec4128fdbc9385e35cc504653326 (diff) | |
download | aspectj-56e0a03e4cb6030fe980c546891214d557070bbd.tar.gz aspectj-56e0a03e4cb6030fe980c546891214d557070bbd.zip |
210470: preventing weaver leaks: use a weak classloader ref
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/tools/PointcutParser.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/weaver/src/org/aspectj/weaver/tools/PointcutParser.java b/weaver/src/org/aspectj/weaver/tools/PointcutParser.java index 3d22f7aae..f6ff5ba03 100644 --- a/weaver/src/org/aspectj/weaver/tools/PointcutParser.java +++ b/weaver/src/org/aspectj/weaver/tools/PointcutParser.java @@ -28,6 +28,7 @@ import org.aspectj.weaver.IntMap; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.UnresolvedType; +import org.aspectj.weaver.WeakClassLoaderReference; import org.aspectj.weaver.World; import org.aspectj.weaver.bcel.AtAjAttributes; import org.aspectj.weaver.internal.tools.PointcutExpressionImpl; @@ -56,7 +57,7 @@ import org.aspectj.weaver.reflect.ReflectionWorld; public class PointcutParser { private ReflectionWorld world; - private ClassLoader classLoader; + private WeakClassLoaderReference classLoaderReference; private Set supportedPrimitives; private Set pointcutDesignators = new HashSet(); @@ -224,8 +225,8 @@ public class PointcutParser { * @param aLoader */ protected void setClassLoader(ClassLoader aLoader) { - this.classLoader = aLoader; - world = new ReflectionWorld(this.classLoader); + this.classLoaderReference = new WeakClassLoaderReference(aLoader); + world = new ReflectionWorld(this.classLoaderReference.getClassLoader()); } /** @@ -235,7 +236,7 @@ public class PointcutParser { * lint properties */ public void setLintProperties(String resourcePath)throws IOException { - URL url = this.classLoader.getResource(resourcePath); + URL url = this.classLoaderReference.getClassLoader().getResource(resourcePath); InputStream is = url.openStream(); Properties p = new Properties(); p.load(is); |