Skip to content

Commit 08000fd

Browse files
pujaganivalfirst
andauthored
Update src/main/java/io/appium/java_client/proxy/Helpers.java
Co-authored-by: Valery Yatsynovich <valeryyatsynovich@gmail.com>
1 parent c262974 commit 08000fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ public static <T> T createProxy(
148148

149149
listeners.stream()
150150
.filter(ProxyAwareListener.class::isInstance)
151-
.forEach(listener -> ((ProxyAwareListener) listener).attachProxyInstance(result));
151+
.map(ProxyAwareListener.class::cast)
152+
.forEach(listener -> listener.attachProxyInstance(result));
152153

153154
return result;
154155
} catch (SecurityException | ReflectiveOperationException e) {

0 commit comments

Comments
 (0)