Skip to content

Commit b339d75

Browse files
committed
Support set use CACHE
1 parent 405a603 commit b339d75

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/main/java/top/niunaijun/blackreflection/BlackReflection.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
@SuppressWarnings("unchecked")
3535
public class BlackReflection {
3636
public static boolean DEBUG = false;
37+
public static boolean CACHE = false;
3738
private static final Map<Class<?>, Object> sProxyCache = new HashMap<>();
3839

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

182183
private static <T> T getProxy(Class<T> clazz, final Object caller, boolean withException) {
184+
if (!CACHE) {
185+
return null;
186+
}
183187
try {
184188
if (!withException) {
185189
if (caller == null) {

0 commit comments

Comments
 (0)