Skip to content

Commit

Permalink
fix get field bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nnjun committed Feb 19, 2022
1 parent 16effbe commit 8d15842
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ public static <T> T create(Class<T> clazz, final Object caller, boolean withExce
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 All @@ -84,7 +84,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
Object call;
Reflector on = Reflector.on(aClass).field(name);
if (isStatic) {
call = on.get(args);
call = on.get();
} else {
if (callerByWeak == null) {
return generateNullValue(returnType);
Expand Down Expand Up @@ -169,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 8d15842

Please sign in to comment.