Skip to content

Commit ebc60c7

Browse files
authored
Update CACHED_PROXY_CLASSES
Replace ConcurrentHashMap with WeakHashMap wrapped with Collections.synchronizedMap to ensure thread-safety.
1 parent f99533c commit ebc60c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class Helpers {
5050
// the performance and to avoid extensive memory usage for our case, where
5151
// the amount of instrumented proxy classes we create is low in comparison to the amount
5252
// of proxy instances.
53-
private static final ConcurrentMap<ProxyClassSignature, Class<?>> CACHED_PROXY_CLASSES = new ConcurrentHashMap<>();
53+
private static final Map<ProxyClassSignature, Class<?>> CACHED_PROXY_CLASSES = Collections.synchronizedMap(new WeakHashMap<>());
5454

5555
private Helpers() {
5656
}

0 commit comments

Comments
 (0)