Skip to content

Commit

Permalink
Fix Cache bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nnjun committed Mar 21, 2022
1 parent b339d75 commit 33628f5
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,17 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
}
});

if (caller == null) {
sProxyCache.put(clazz, o);
} else {
Map<Class<?>, Object> callerClassMap = sCallerProxyCache.get(caller);
if (callerClassMap == null) {
callerClassMap = new HashMap<>();
sCallerProxyCache.put(caller, callerClassMap);
if (CACHE) {
if (caller == null) {
sProxyCache.put(clazz, o);
} else {
Map<Class<?>, Object> callerClassMap = sCallerProxyCache.get(caller);
if (callerClassMap == null) {
callerClassMap = new HashMap<>();
sCallerProxyCache.put(caller, callerClassMap);
}
callerClassMap.put(clazz, o);
}
callerClassMap.put(clazz, o);
}
return (T) o;
} catch (ClassNotFoundException e) {
Expand Down

0 comments on commit 33628f5

Please sign in to comment.