Skip to content

Commit 8370c14

Browse files
committed
[java] Formatting files
1 parent 9d6842d commit 8370c14

40 files changed

+331
-306
lines changed

java/src/org/openqa/selenium/By.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.Map;
2424
import java.util.Objects;
2525
import java.util.regex.Pattern;
26-
2726
import org.openqa.selenium.internal.Require;
2827

2928
/**
@@ -416,7 +415,8 @@ protected final Map<String, Object> toJson() {
416415
}
417416

418417
private abstract static class PreW3CLocator extends By implements Remotable {
419-
private static final Pattern CSS_ESCAPE = Pattern.compile("([\\s'\"\\\\#.:;,!?+<>=~*^$|%&@`{}\\-\\/\\[\\]\\(\\)])");
418+
private static final Pattern CSS_ESCAPE =
419+
Pattern.compile("([\\s'\"\\\\#.:;,!?+<>=~*^$|%&@`{}\\-\\/\\[\\]\\(\\)])");
420420
private final Parameters remoteParams;
421421
private final ByCssSelector fallback;
422422

java/src/org/openqa/selenium/SharedCapabilitiesMethods.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,21 @@ private SharedCapabilitiesMethods() {
3838
static int hashCode(Capabilities caps) {
3939
String[] sortedNames = caps.getCapabilityNames().toArray(EMPTY_ARRAY);
4040
Arrays.sort(sortedNames, String::compareTo);
41-
// we only use the names to generate a hash code, this might result in hash collisions. thanks to the
42-
// moz:firefoxOptions, goog:chromeOptions and ms:edgeOptions, these hash collisions should not happen too often.
41+
// we only use the names to generate a hash code, this might result in hash collisions. thanks
42+
// to the
43+
// moz:firefoxOptions, goog:chromeOptions and ms:edgeOptions, these hash collisions should not
44+
// happen too often.
4345
return Arrays.hashCode(sortedNames);
4446
}
4547

4648
static boolean equals(Capabilities left, Capabilities right) {
4749
if (left == right) {
4850
return true;
4951
}
50-
// deeply compare the keys & values, usually only called when the hash codes of two objects are identical.
51-
// note: there should be no arrays (directly or nested) inside the map, otherwise the equals will not work.
52+
// deeply compare the keys & values, usually only called when the hash codes of two objects are
53+
// identical.
54+
// note: there should be no arrays (directly or nested) inside the map, otherwise the equals
55+
// will not work.
5256
return left.asMap().equals(right.asMap());
5357
}
5458

java/src/org/openqa/selenium/bidi/Connection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ private void handleEventResponse(Map<String, Object> rawDataMap) {
305305
LOG.log(
306306
getDebugLogLevel(),
307307
"Matching {0} with {1}",
308-
new Object[] { rawDataMap.get("method"), event.getMethod() });
308+
new Object[] {rawDataMap.get("method"), event.getMethod()});
309309
return rawDataMap.get("method").equals(event.getMethod());
310310
})
311311
.forEach(
@@ -327,7 +327,7 @@ private void handleEventResponse(Map<String, Object> rawDataMap) {
327327
LOG.log(
328328
getDebugLogLevel(),
329329
"Calling callback for {0} using {1} being passed {2}",
330-
new Object[] { event, obj, finalValue });
330+
new Object[] {event, obj, finalValue});
331331
obj.accept(finalValue);
332332
}
333333
});

java/src/org/openqa/selenium/chrome/ChromeDriverInfo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public boolean isAvailable() {
8585
@Override
8686
public boolean isPresent() {
8787
try {
88-
DriverFinder.getPath(ChromeDriverService.createDefaultService(), getCanonicalCapabilities(), true);
88+
DriverFinder.getPath(
89+
ChromeDriverService.createDefaultService(), getCanonicalCapabilities(), true);
8990
return true;
9091
} catch (IllegalStateException | WebDriverException e) {
9192
return false;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ protected ChromiumDriver(
170170
+ " where the version (\"v86\") matches the version of the"
171171
+ " chromium-based browser you're using and the version number of the"
172172
+ " artifact is the same as Selenium's.",
173-
originalCapabilities.getBrowserVersion(), new BuildInfo().getReleaseLabel()));
173+
originalCapabilities.getBrowserVersion(),
174+
new BuildInfo().getReleaseLabel()));
174175
return new NoOpCdpInfo();
175176
});
176177

java/src/org/openqa/selenium/devtools/Connection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private void handle(CharSequence data) {
271271
LOG.log(
272272
getDebugLogLevel(),
273273
"Method {0} called with {1} callbacks available",
274-
new Object[] { raw.get("method"), eventCallbacks.keySet().size() });
274+
new Object[] {raw.get("method"), eventCallbacks.keySet().size()});
275275
Lock lock = callbacksLock.readLock();
276276
lock.lock();
277277
try {
@@ -282,7 +282,7 @@ private void handle(CharSequence data) {
282282
LOG.log(
283283
getDebugLogLevel(),
284284
"Matching {0} with {1}",
285-
new Object[]{ raw.get("method"), event.getMethod()}))
285+
new Object[] {raw.get("method"), event.getMethod()}))
286286
.filter(event -> raw.get("method").equals(event.getMethod()))
287287
.forEach(
288288
event -> {
@@ -317,7 +317,7 @@ private void handle(CharSequence data) {
317317
LOG.log(
318318
getDebugLogLevel(),
319319
"Calling callback for {0} using {1} being passed {2}",
320-
new Object[] { event, obj, finalValue });
320+
new Object[] {event, obj, finalValue});
321321
obj.accept(finalValue);
322322
}
323323
}

java/src/org/openqa/selenium/devtools/v115/v115Events.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
package org.openqa.selenium.devtools.v115;
1919

2020
import com.google.common.collect.ImmutableList;
21+
import java.time.Instant;
22+
import java.util.List;
23+
import java.util.Optional;
2124
import org.openqa.selenium.JavascriptException;
2225
import org.openqa.selenium.devtools.Command;
2326
import org.openqa.selenium.devtools.DevTools;
@@ -31,10 +34,6 @@
3134
import org.openqa.selenium.devtools.v115.runtime.model.ExceptionThrown;
3235
import org.openqa.selenium.devtools.v115.runtime.model.StackTrace;
3336

34-
import java.time.Instant;
35-
import java.util.List;
36-
import java.util.Optional;
37-
3837
public class v115Events extends Events<ConsoleAPICalled, ExceptionThrown> {
3938

4039
public v115Events(DevTools devtools) {

java/src/org/openqa/selenium/devtools/v115/v115Javascript.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.openqa.selenium.devtools.v115;
1919

20+
import java.util.Optional;
2021
import org.openqa.selenium.devtools.Command;
2122
import org.openqa.selenium.devtools.DevTools;
2223
import org.openqa.selenium.devtools.Event;
@@ -26,8 +27,6 @@
2627
import org.openqa.selenium.devtools.v115.runtime.Runtime;
2728
import org.openqa.selenium.devtools.v115.runtime.model.BindingCalled;
2829

29-
import java.util.Optional;
30-
3130
public class v115Javascript extends Javascript<ScriptIdentifier, BindingCalled> {
3231

3332
public v115Javascript(DevTools devtools) {

java/src/org/openqa/selenium/devtools/v115/v115Log.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.openqa.selenium.devtools.v115;
1919

20+
import java.util.function.Function;
21+
import java.util.logging.Level;
2022
import org.openqa.selenium.devtools.Command;
2123
import org.openqa.selenium.devtools.ConverterFunctions;
2224
import org.openqa.selenium.devtools.Event;
@@ -25,9 +27,6 @@
2527
import org.openqa.selenium.devtools.v115.runtime.model.Timestamp;
2628
import org.openqa.selenium.json.JsonInput;
2729

28-
import java.util.function.Function;
29-
import java.util.logging.Level;
30-
3130
public class v115Log implements org.openqa.selenium.devtools.idealized.log.Log {
3231

3332
@Override

java/src/org/openqa/selenium/devtools/v115/v115Network.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@
1717

1818
package org.openqa.selenium.devtools.v115;
1919

20+
import static java.net.HttpURLConnection.HTTP_OK;
21+
2022
import com.google.common.collect.ImmutableList;
2123
import com.google.common.io.ByteStreams;
24+
import java.io.ByteArrayOutputStream;
25+
import java.io.IOException;
26+
import java.io.InputStream;
27+
import java.util.*;
28+
import java.util.logging.Logger;
2229
import org.openqa.selenium.UsernameAndPassword;
2330
import org.openqa.selenium.devtools.Command;
2431
import org.openqa.selenium.devtools.DevTools;
@@ -32,14 +39,6 @@
3239
import org.openqa.selenium.remote.http.HttpRequest;
3340
import org.openqa.selenium.remote.http.HttpResponse;
3441

35-
import java.io.ByteArrayOutputStream;
36-
import java.io.IOException;
37-
import java.io.InputStream;
38-
import java.util.*;
39-
import java.util.logging.Logger;
40-
41-
import static java.net.HttpURLConnection.HTTP_OK;
42-
4342
public class v115Network extends Network<AuthRequired, RequestPaused> {
4443

4544
private static final Logger LOG = Logger.getLogger(v115Network.class.getName());

0 commit comments

Comments
 (0)