Skip to content

Commit 11b1771

Browse files
committed
[java] Formatting files
1 parent 1b600b1 commit 11b1771

File tree

7 files changed

+21
-25
lines changed

7 files changed

+21
-25
lines changed

java/src/org/openqa/selenium/json/JsonOutput.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ public class JsonOutput implements Closeable {
175175
Collection.class::isAssignableFrom,
176176
(obj, depth) -> {
177177
if (depth < 1) {
178-
throw new JsonException("Reached the maximum depth of " + MAX_DEPTH + " while writing JSON");
178+
throw new JsonException(
179+
"Reached the maximum depth of " + MAX_DEPTH + " while writing JSON");
179180
}
180181
beginArray();
181182
((Collection<?>) obj)
@@ -189,7 +190,8 @@ public class JsonOutput implements Closeable {
189190
Map.class::isAssignableFrom,
190191
(obj, depth) -> {
191192
if (depth < 1) {
192-
throw new JsonException("Reached the maximum depth of " + MAX_DEPTH + " while writing JSON");
193+
throw new JsonException(
194+
"Reached the maximum depth of " + MAX_DEPTH + " while writing JSON");
193195
}
194196
beginObject();
195197
((Map<?, ?>) obj)
@@ -206,7 +208,8 @@ public class JsonOutput implements Closeable {
206208
Class::isArray,
207209
(obj, depth) -> {
208210
if (depth < 1) {
209-
throw new JsonException("Reached the maximum depth of " + MAX_DEPTH + " while writing JSON");
211+
throw new JsonException(
212+
"Reached the maximum depth of " + MAX_DEPTH + " while writing JSON");
210213
}
211214
beginArray();
212215
Stream.of((Object[]) obj)
@@ -228,12 +231,15 @@ public class JsonOutput implements Closeable {
228231
});
229232

230233
// Finally, attempt to convert as an object
231-
builder.put(cls -> true, (obj, depth) -> {
232-
if (depth < 1) {
233-
throw new JsonException("Reached the maximum depth of " + MAX_DEPTH + " while writing JSON");
234-
}
235-
mapObject(obj, depth - 1);
236-
});
234+
builder.put(
235+
cls -> true,
236+
(obj, depth) -> {
237+
if (depth < 1) {
238+
throw new JsonException(
239+
"Reached the maximum depth of " + MAX_DEPTH + " while writing JSON");
240+
}
241+
mapObject(obj, depth - 1);
242+
});
237243

238244
this.converters = Collections.unmodifiableMap(builder);
239245
}

java/src/org/openqa/selenium/remote/html5/AddWebStorage.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ public class AddWebStorage implements AugmenterProvider<WebStorage> {
3232

3333
@Override
3434
public Predicate<Capabilities> isApplicable() {
35-
return caps ->
36-
FIREFOX.is(caps)
37-
|| CHROME.is(caps)
38-
|| EDGE.is(caps)
39-
|| OPERA.is(caps);
35+
return caps -> FIREFOX.is(caps) || CHROME.is(caps) || EDGE.is(caps) || OPERA.is(caps);
4036
}
4137

4238
@Override

java/src/org/openqa/selenium/remote/http/jdk/JdkHttpClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ public void onError(java.net.http.WebSocket webSocket, Throwable error) {
214214
java.net.http.WebSocket underlyingSocket;
215215

216216
try {
217-
underlyingSocket = webSocketCompletableFuture.get(readTimeout.toMillis(), TimeUnit.MILLISECONDS);
217+
underlyingSocket =
218+
webSocketCompletableFuture.get(readTimeout.toMillis(), TimeUnit.MILLISECONDS);
218219
} catch (CancellationException e) {
219220
throw new WebDriverException(e.getMessage(), e);
220221
} catch (ExecutionException e) {
@@ -367,7 +368,8 @@ public HttpResponse execute(HttpRequest req) throws UncheckedIOException {
367368
java.net.http.HttpResponse<byte[]> response;
368369

369370
// use sendAsync to not run into https://bugs.openjdk.org/browse/JDK-8258397
370-
CompletableFuture<java.net.http.HttpResponse<byte[]>> future = client.sendAsync(request, byteHandler);
371+
CompletableFuture<java.net.http.HttpResponse<byte[]>> future =
372+
client.sendAsync(request, byteHandler);
371373

372374
try {
373375
response = future.get(readTimeout.toMillis(), TimeUnit.MILLISECONDS);

java/test/org/openqa/selenium/ElementAccessibleNameTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import org.junit.jupiter.api.Test;
2323
import org.openqa.selenium.environment.webserver.Page;
2424
import org.openqa.selenium.testing.JupiterTestBase;
25-
import org.openqa.selenium.testing.NotYetImplemented;
26-
import org.openqa.selenium.testing.drivers.Browser;
2725

2826
class ElementAccessibleNameTest extends JupiterTestBase {
2927

java/test/org/openqa/selenium/ElementAriaRoleTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import org.junit.jupiter.api.Test;
2323
import org.openqa.selenium.environment.webserver.Page;
2424
import org.openqa.selenium.testing.JupiterTestBase;
25-
import org.openqa.selenium.testing.NotYetImplemented;
26-
import org.openqa.selenium.testing.drivers.Browser;
2725

2826
class ElementAriaRoleTest extends JupiterTestBase {
2927

java/test/org/openqa/selenium/ElementDomPropertyTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@
1818
package org.openqa.selenium;
1919

2020
import static org.assertj.core.api.Assertions.assertThat;
21-
import static org.openqa.selenium.testing.drivers.Browser.CHROME;
22-
import static org.openqa.selenium.testing.drivers.Browser.EDGE;
2321

2422
import java.util.List;
2523
import org.junit.jupiter.api.Test;
2624
import org.openqa.selenium.support.ui.ExpectedConditions;
2725
import org.openqa.selenium.testing.JupiterTestBase;
28-
import org.openqa.selenium.testing.NotYetImplemented;
2926

3027
class ElementDomPropertyTest extends JupiterTestBase {
3128

java/test/org/openqa/selenium/json/JsonOutputTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,7 @@ void shouldRespectMaxDepth() {
735735

736736
Object finalValue = value;
737737

738-
assertThatExceptionOfType(JsonException.class)
739-
.isThrownBy(() -> jsonOutput.write(finalValue));
738+
assertThatExceptionOfType(JsonException.class).isThrownBy(() -> jsonOutput.write(finalValue));
740739
}
741740

742741
private String convert(Object toConvert) {

0 commit comments

Comments
 (0)