Skip to content

Commit

Permalink
Optimize Proxy WeakReference to SoftReference (#7536)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoheng1 committed Apr 12, 2021
1 parent 82ff056 commit b7bd6ad
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -21,7 +21,6 @@

import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
Expand Down Expand Up @@ -152,7 +151,7 @@ public static Proxy getProxy(ClassLoader cl, Class<?>... ics) {
if (null == proxy) {
cache.remove(key);
} else {
cache.put(key, new WeakReference<Proxy>(proxy));
cache.put(key, new SoftReference<Proxy>(proxy));
}
}
}
Expand Down Expand Up @@ -251,7 +250,7 @@ public static Proxy getProxy(ClassLoader cl, Class<?>... ics) {
if (proxy == null) {
cache.remove(key);
} else {
cache.put(key, new WeakReference<Proxy>(proxy));
cache.put(key, new SoftReference<>(proxy));
}
cache.notifyAll();
}
Expand Down

0 comments on commit b7bd6ad

Please sign in to comment.