Skip to content

Commit d0a07bd

Browse files
committed
replace anonimous class with lambda
1 parent 81f435d commit d0a07bd

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

java/src/org/openqa/selenium/chromium/AddHasCdp.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,16 @@ public Class<HasCdp> getDescribedInterface() {
4747

4848
@Override
4949
public HasCdp getImplementation(Capabilities capabilities, ExecuteMethod executeMethod) {
50-
return new HasCdp() {
51-
@Override
52-
public Map<String, Object> executeCdpCommand(
53-
String commandName, Map<String, Object> parameters) {
54-
Require.nonNull("Command name", commandName);
55-
Require.nonNull("Parameters", parameters);
50+
return (commandName, parameters) -> {
51+
Require.nonNull("Command name", commandName);
52+
Require.nonNull("Parameters", parameters);
5653

57-
Map<String, Object> toReturn =
58-
(Map<String, Object>)
59-
executeMethod.execute(
60-
EXECUTE_CDP, Map.of("cmd", commandName, "params", parameters));
54+
Map<String, Object> toReturn =
55+
(Map<String, Object>)
56+
executeMethod.execute(
57+
EXECUTE_CDP, Map.of("cmd", commandName, "params", parameters));
6158

62-
return Map.copyOf(toReturn);
63-
}
59+
return Map.copyOf(toReturn);
6460
};
6561
}
6662
}

0 commit comments

Comments
 (0)