Skip to content

Commit

Permalink
Update BlackReflection.java
Browse files Browse the repository at this point in the history
  • Loading branch information
nnjun committed Feb 19, 2022
1 parent d38cdd6 commit 16effbe
Showing 1 changed file with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ public static <T> T create(Class<T> clazz, final Object caller, boolean withExce
if (o != null) {
return (T) o;
}
} else {
Map<Class<?>, Object> callerClassMap = sCallerProxyCache.get(caller);
if (callerClassMap != null) {
Object o = callerClassMap.get(clazz);
if (o != null) {
return (T) o;
}
}
}
// else {
// Map<Class<?>, Object> callerClassMap = sCallerProxyCache.get(caller);
// if (callerClassMap != null) {
// Object o = callerClassMap.get(clazz);
// if (o != null) {
// return (T) o;
// }
// }
// }
}

final WeakReference<Object> weakCaller = caller == null ? null : new WeakReference<>(caller);
Expand Down Expand Up @@ -168,12 +169,12 @@ 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);
}
callerClassMap.put(clazz, o);
// Map<Class<?>, Object> callerClassMap = sCallerProxyCache.get(caller);
// if (callerClassMap == null) {
// callerClassMap = new HashMap<>();
// sCallerProxyCache.put(caller, callerClassMap);
// }
// callerClassMap.put(clazz, o);
}
return (T) o;
} catch (ClassNotFoundException e) {
Expand Down

0 comments on commit 16effbe

Please sign in to comment.