Skip to content

Commit 9a8c1bf

Browse files
authored
Update Helpers.java
1 parent 8313002 commit 9a8c1bf

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/main/java/io/appium/java_client/proxy/Helpers.java

+4-15
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616

1717
package io.appium.java_client.proxy;
1818

19-
import com.google.common.annotations.VisibleForTesting;
2019
import com.google.common.base.Preconditions;
21-
import java.util.Map;
22-
import java.util.WeakHashMap;
2320
import lombok.Value;
2421
import net.bytebuddy.ByteBuddy;
2522
import net.bytebuddy.description.method.MethodDescription;
@@ -34,7 +31,9 @@
3431
import java.lang.reflect.Method;
3532
import java.util.Collection;
3633
import java.util.Collections;
34+
import java.util.Map;
3735
import java.util.Set;
36+
import java.util.WeakHashMap;
3837
import java.util.stream.Collectors;
3938
import java.util.stream.Stream;
4039

@@ -51,18 +50,8 @@ public class Helpers {
5150
// the performance and to avoid extensive memory usage for our case, where
5251
// the amount of instrumented proxy classes we create is low in comparison to the amount
5352
// of proxy instances.
54-
private static final Map<ProxyClassSignature, Class<?>> CACHED_PROXY_CLASSES = Collections.synchronizedMap(new WeakHashMap<>());
55-
56-
/**
57-
* Gets CACHED_PROXY_CLASSES size.
58-
* Used for cache clear up tests {@see io.appium.java_client.pagefactory_tests.widget.tests.combined.CombinedWidgetTest}.
59-
*
60-
* @return the cached proxy classes size
61-
*/
62-
@VisibleForTesting
63-
public static int getCachedProxyClassesSize() {
64-
return CACHED_PROXY_CLASSES.size();
65-
}
53+
private static final Map<ProxyClassSignature, Class<?>> CACHED_PROXY_CLASSES =
54+
Collections.synchronizedMap(new WeakHashMap<>());
6655

6756
private Helpers() {
6857
}

0 commit comments

Comments
 (0)