Skip to content

Commit 6ffd2ea

Browse files
Fixing issuies before the merging
1 parent afa1039 commit 6ffd2ea

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

src/main/java/io/appium/java_client/remote/MobileCapabilityType.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ public interface MobileCapabilityType extends CapabilityType {
5656
*/
5757
String APP = "app";
5858

59-
/**
60-
* Name of mobile web browser to automate.
61-
* Should be an empty string if automating an app instead.
62-
*/
63-
String BROWSER_NAME = "browserName";
64-
6559
/**
6660
* Unique device identifier of the connected physical device.
6761
*/

src/main/java/org/openqa/selenium/remote/NewSessionPayload.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private NewSessionPayload(Reader source, boolean forceMobileJSONWP) throws IOExc
172172
if (getOss() != null) {
173173
dialects.add(Dialect.OSS);
174174
}
175-
if (getAlwaysMatch() != null || getFirstMatches() != null) {
175+
if (getAlwaysMatch() != null || getFirstMatch() != null) {
176176
dialects.add(Dialect.W3C);
177177
}
178178

@@ -185,7 +185,7 @@ private void validate() throws IOException {
185185
alwaysMatch = of();
186186
}
187187
Map<String, Object> always = alwaysMatch;
188-
Collection<Map<String, Object>> firsts = getFirstMatches();
188+
Collection<Map<String, Object>> firsts = getFirstMatch();
189189
if (firsts == null) {
190190
firsts = ImmutableList.of(of());
191191
}
@@ -400,25 +400,25 @@ public Object getValue() {
400400
public Object setValue(Object value) {
401401
return stringObjectEntry.setValue(value);
402402
}})
403-
.collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, Map.Entry::getValue)))
403+
.collect(toImmutableMap(Map.Entry::getKey, Map.Entry::getValue)))
404404
.map(map -> (Map<String, Object>) map);
405405
} else {
406406
fromOss = Stream.of();
407407
}
408408

409409
Stream<Map<String, Object>> fromW3c;
410410
Map<String, Object> alwaysMatch = getAlwaysMatch();
411-
Collection<Map<String, Object>> firsts = getFirstMatches();
411+
Collection<Map<String, Object>> firsts = getFirstMatch();
412412

413413
if (alwaysMatch == null && firsts == null) {
414414
fromW3c = Stream.of(); // No W3C capabilities.
415415
} else {
416416
if (alwaysMatch == null) {
417-
alwaysMatch = ImmutableMap.of();
417+
alwaysMatch = of();
418418
}
419419
Map<String, Object> always = alwaysMatch; // Keep the comoiler happy.
420420
if (firsts == null) {
421-
firsts = ImmutableList.of(ImmutableMap.of());
421+
firsts = ImmutableList.of(of());
422422
}
423423

424424
fromW3c = firsts.stream()
@@ -457,9 +457,8 @@ public Object setValue(Object value) {
457457
name = input.nextName();
458458
if (ALWAYS_MATCH.equals(name)) {
459459
return input.read(MAP_TYPE);
460-
} else {
461-
input.skipValue();
462460
}
461+
input.skipValue();
463462
}
464463
input.endObject();
465464
} else {
@@ -470,7 +469,7 @@ public Object setValue(Object value) {
470469
return null;
471470
}
472471

473-
private @Nullable Collection<Map<String, Object>> getFirstMatches() throws IOException {
472+
private @Nullable Collection<Map<String, Object>> getFirstMatch() throws IOException {
474473
CharSource charSource = backingStore.asByteSource().asCharSource(UTF_8);
475474
try (Reader reader = charSource.openBufferedStream();
476475
JsonInput input = json.newInput(reader)) {
@@ -483,9 +482,8 @@ public Object setValue(Object value) {
483482
name = input.nextName();
484483
if (FIRST_MATCH.equals(name)) {
485484
return input.read(LIST_OF_MAPS_TYPE);
486-
} else {
487-
input.skipValue();
488485
}
486+
input.skipValue();
489487
}
490488
input.endObject();
491489
} else {

0 commit comments

Comments
 (0)