Skip to content

Commit

Permalink
Support set use CACHE
Browse files Browse the repository at this point in the history
  • Loading branch information
nnjun committed Mar 19, 2022
1 parent 405a603 commit b339d75
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
@SuppressWarnings("unchecked")
public class BlackReflection {
public static boolean DEBUG = false;
public static boolean CACHE = false;
private static final Map<Class<?>, Object> sProxyCache = new HashMap<>();

// key caller
Expand Down Expand Up @@ -180,6 +181,9 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
}

private static <T> T getProxy(Class<T> clazz, final Object caller, boolean withException) {
if (!CACHE) {
return null;
}
try {
if (!withException) {
if (caller == null) {
Expand Down

0 comments on commit b339d75

Please sign in to comment.