File tree Expand file tree Collapse file tree 8 files changed +10
-24
lines changed
test/org/openqa/selenium/build Expand file tree Collapse file tree 8 files changed +10
-24
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,7 @@ public boolean isSupporting(Capabilities capabilities) {
50
50
}
51
51
52
52
return capabilities .asMap ().keySet ().stream ()
53
- .map (key -> key .startsWith ("moz:" ))
54
- .reduce (Boolean ::logicalOr )
55
- .orElse (false );
53
+ .anyMatch (key -> key .startsWith ("moz:" ));
56
54
}
57
55
58
56
@ Override
Original file line number Diff line number Diff line change @@ -41,9 +41,7 @@ public DistributorStatus(Collection<NodeStatus> allNodes) {
41
41
42
42
public boolean hasCapacity () {
43
43
return getNodes ().stream ()
44
- .map (node -> node .getAvailability ().equals (Availability .UP ) && node .hasCapacity ())
45
- .reduce (Boolean ::logicalOr )
46
- .orElse (false );
44
+ .anyMatch (node -> node .getAvailability ().equals (Availability .UP ) && node .hasCapacity ());
47
45
}
48
46
49
47
public Set <NodeStatus > getNodes () {
Original file line number Diff line number Diff line change @@ -43,9 +43,7 @@ public boolean test(HttpRequest request) {
43
43
@ Override
44
44
public boolean matches (HttpRequest req ) {
45
45
return handlers .keySet ().stream ()
46
- .map (p -> p .matches (req ))
47
- .reduce (Boolean ::logicalOr )
48
- .orElse (false );
46
+ .anyMatch (p -> p .matches (req ));
49
47
}
50
48
51
49
@ Override
Original file line number Diff line number Diff line change @@ -49,9 +49,7 @@ public PathResource limit(String... subpaths) {
49
49
base ,
50
50
path ->
51
51
Arrays .stream (subpaths )
52
- .map (subpath -> Files .exists (base .resolve (subpath )))
53
- .reduce (Boolean ::logicalOr )
54
- .orElse (false ));
52
+ .anyMatch (subpath -> Files .exists (base .resolve (subpath ))));
55
53
}
56
54
57
55
@ Override
Original file line number Diff line number Diff line change @@ -28,9 +28,7 @@ public class Debug {
28
28
static {
29
29
boolean debugFlag =
30
30
ManagementFactory .getRuntimeMXBean ().getInputArguments ().stream ()
31
- .map (str -> str .contains ("-agentlib:jdwp" ))
32
- .reduce (Boolean ::logicalOr )
33
- .orElse (false );
31
+ .anyMatch (str -> str .contains ("-agentlib:jdwp" ));
34
32
boolean simpleProperty = Boolean .getBoolean ("selenium.debug" );
35
33
boolean longerProperty = Boolean .getBoolean ("selenium.webdriver.verbose" );
36
34
Original file line number Diff line number Diff line change @@ -49,10 +49,8 @@ public boolean isSupporting(Capabilities capabilities) {
49
49
return true ;
50
50
}
51
51
52
- return capabilities .asMap ().keySet ().parallelStream ()
53
- .map (key -> key .startsWith ("safari:" ))
54
- .reduce (Boolean ::logicalOr )
55
- .orElse (false );
52
+ return capabilities .asMap ().keySet ().stream ()
53
+ .anyMatch (key -> key .startsWith ("safari:" ));
56
54
}
57
55
58
56
@ Override
Original file line number Diff line number Diff line change @@ -50,10 +50,8 @@ public boolean isSupporting(Capabilities capabilities) {
50
50
return true ;
51
51
}
52
52
53
- return capabilities .asMap ().keySet ().parallelStream ()
54
- .map (key -> key .startsWith ("safari:" ))
55
- .reduce (Boolean ::logicalOr )
56
- .orElse (false );
53
+ return capabilities .asMap ().keySet ().stream ()
54
+ .anyMatch (key -> key .startsWith ("safari:" ));
57
55
}
58
56
59
57
@ Override
Original file line number Diff line number Diff line change @@ -53,6 +53,6 @@ public class DevMode {
53
53
() -> Boolean .getBoolean ("selenium.dev-mode" ));
54
54
55
55
public static boolean isInDevMode () {
56
- return DEV_MODE_CHECKS .stream ().map (Supplier ::get ). reduce ( Boolean :: logicalOr ). orElse ( false );
56
+ return DEV_MODE_CHECKS .stream ().anyMatch (Supplier ::get );
57
57
}
58
58
}
You can’t perform that action at this time.
0 commit comments