Skip to content

Commit d76e454

Browse files
committed
[java] Adding missing @deprecated annotation to the method deprecated long ago
1 parent 54d387b commit d76e454

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

java/client/src/org/openqa/selenium/Capabilities.java

+17-16
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,29 @@ default String getBrowserName() {
3737
/**
3838
* @deprecated Use {@link #getPlatformName()}
3939
*/
40+
@Deprecated
4041
default Platform getPlatform() {
4142
return getPlatformName();
4243
}
4344

4445
default Platform getPlatformName() {
4546
return Stream.of("platform", "platformName")
46-
.map(this::getCapability)
47-
.filter(Objects::nonNull)
48-
.map(cap -> {
49-
if (cap instanceof Platform) {
50-
return (Platform) cap;
51-
}
47+
.map(this::getCapability)
48+
.filter(Objects::nonNull)
49+
.map(cap -> {
50+
if (cap instanceof Platform) {
51+
return (Platform) cap;
52+
}
5253

53-
try {
54-
return Platform.fromString((String.valueOf(cap)));
55-
} catch (WebDriverException e) {
56-
return null;
57-
}
58-
})
59-
.filter(Objects::nonNull)
60-
.findFirst()
61-
.orElse(null);
54+
try {
55+
return Platform.fromString((String.valueOf(cap)));
56+
} catch (WebDriverException e) {
57+
return null;
58+
}
59+
})
60+
.filter(Objects::nonNull)
61+
.findFirst()
62+
.orElse(null);
6263
}
6364

6465
/**
@@ -71,7 +72,7 @@ default String getVersion() {
7172

7273
default String getBrowserVersion() {
7374
return String.valueOf(Optional.ofNullable(getCapability("browserVersion")).orElse(
74-
Optional.ofNullable(getCapability("version")).orElse("")));
75+
Optional.ofNullable(getCapability("version")).orElse("")));
7576
}
7677

7778
/**

0 commit comments

Comments
 (0)