Skip to content

Commit cc4afff

Browse files
committed
[grid] Code styling and removing unused import
[skip ci]
1 parent 77788e0 commit cc4afff

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

java/server/src/org/openqa/selenium/grid/distributor/selector/DefaultSlotSelector.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.openqa.selenium.grid.distributor.selector;
1919

2020
import com.google.common.annotations.VisibleForTesting;
21+
2122
import org.openqa.selenium.Capabilities;
2223
import org.openqa.selenium.grid.config.Config;
2324
import org.openqa.selenium.grid.data.NodeStatus;
@@ -31,6 +32,10 @@
3132

3233
public class DefaultSlotSelector implements SlotSelector {
3334

35+
public static SlotSelector create(Config config) {
36+
return new DefaultSlotSelector();
37+
}
38+
3439
@Override
3540
public Set<SlotId> selectSlot(Capabilities capabilities, Set<NodeStatus> nodes) {
3641
// First, filter the Nodes that support the required capabilities. Then, the filtered Nodes
@@ -51,7 +56,7 @@ public Set<SlotId> selectSlot(Capabilities capabilities, Set<NodeStatus> nodes)
5156
// And use the node id as a tie-breaker.
5257
.thenComparing(NodeStatus::getNodeId))
5358
.flatMap(node -> node.getSlots().stream()
54-
.filter(slot -> slot.getSession()==null)
59+
.filter(slot -> slot.getSession() == null)
5560
.filter(slot -> slot.isSupporting(capabilities))
5661
.map(Slot::getId))
5762
.collect(toImmutableSet());
@@ -65,8 +70,4 @@ long getNumberOfSupportedBrowsers(NodeStatus nodeStatus) {
6570
.distinct()
6671
.count();
6772
}
68-
69-
public static SlotSelector create(Config config) {
70-
return new DefaultSlotSelector();
71-
}
7273
}

java/server/src/org/openqa/selenium/grid/node/local/LocalNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.common.cache.RemovalListener;
2525
import com.google.common.collect.ImmutableList;
2626
import com.google.common.collect.ImmutableMap;
27+
2728
import org.openqa.selenium.Capabilities;
2829
import org.openqa.selenium.ImmutableCapabilities;
2930
import org.openqa.selenium.NoSuchSessionException;
@@ -82,7 +83,6 @@
8283
import java.util.Set;
8384
import java.util.UUID;
8485
import java.util.concurrent.ExecutionException;
85-
import java.util.concurrent.atomic.AtomicBoolean;
8686
import java.util.concurrent.atomic.AtomicInteger;
8787
import java.util.logging.Logger;
8888
import java.util.stream.Collectors;
@@ -468,7 +468,7 @@ private URI rewrite(String path) {
468468
}
469469
}
470470

471-
private void killSession(SessionSlot slot) {
471+
private void killSession(SessionSlot slot) {
472472
currentSessions.invalidate(slot.getSession().getId());
473473
// Attempt to stop the session
474474
if (!slot.isAvailable()) {

0 commit comments

Comments
 (0)