diff options
author | aclement <aclement> | 2011-11-17 21:20:07 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-11-17 21:20:07 +0000 |
commit | 51632439ca42fc130148eaa8715d406416fdda6d (patch) | |
tree | e8d2d82d34f6656730fb60064947d3f930c17de4 /org.aspectj.matcher/src | |
parent | c683091ce2887b8d5f406cc019c0001bf695434e (diff) | |
download | aspectj-51632439ca42fc130148eaa8715d406416fdda6d.tar.gz aspectj-51632439ca42fc130148eaa8715d406416fdda6d.zip |
363962
Diffstat (limited to 'org.aspectj.matcher/src')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/WeakClassLoaderReference.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/WeakClassLoaderReference.java b/org.aspectj.matcher/src/org/aspectj/weaver/WeakClassLoaderReference.java index bcf650286..ddca93202 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/WeakClassLoaderReference.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/WeakClassLoaderReference.java @@ -30,9 +30,9 @@ import java.lang.ref.WeakReference; * be using this weaver if its associated ClassLoader has been collected. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=210470 * * - * @author Andy Clement + * @author Andy Clement, Abraham Nevado */ -public class WeakClassLoaderReference { +public class WeakClassLoaderReference{ protected final int hashcode; @@ -40,7 +40,13 @@ public class WeakClassLoaderReference { public WeakClassLoaderReference(ClassLoader loader) { loaderRef = new WeakReference(loader); - hashcode = loader.hashCode() * 37; + if(loader == null){ + // Bug: 363962 + // Check that ClassLoader is not null, for instance when loaded from BootStrapClassLoader + hashcode = System.identityHashCode(this); + }else{ + hashcode = loader.hashCode() * 37; + } } public ClassLoader getClassLoader() { |