Skip to content

Commit dd15bc0

Browse files
removal of the unnecessary casting
1 parent b83b090 commit dd15bc0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static com.google.common.base.Throwables.throwIfUnchecked;
2121
import static java.util.Optional.ofNullable;
2222

23-
import com.google.common.base.Function;
2423
import com.google.common.base.Supplier;
2524
import com.google.common.base.Throwables;
2625

@@ -49,7 +48,7 @@ private AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands, Drive
4948
HttpClient.Factory httpClientFactory) {
5049
super(additionalCommands,
5150
ofNullable(service)
52-
.map((Function<DriverService, URL>) DriverService::getUrl)
51+
.map(DriverService::getUrl)
5352
.orElse(addressOfRemoteServer), httpClientFactory);
5453
serviceOptional = ofNullable(service);
5554
}
@@ -58,7 +57,7 @@ public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands, Driver
5857
HttpClient.Factory httpClientFactory) {
5958
this(additionalCommands, checkNotNull(service), null, httpClientFactory);
6059
}
61-
60+
6261
public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands,
6362
URL addressOfRemoteServer, HttpClient.Factory httpClientFactory) {
6463
this(additionalCommands, null, checkNotNull(addressOfRemoteServer), httpClientFactory);
@@ -92,7 +91,7 @@ public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands,
9291
Throwable rootCause = Throwables.getRootCause(t);
9392
if (rootCause instanceof ConnectException
9493
&& rootCause.getMessage().contains("Connection refused")) {
95-
throw serviceOptional.map((Function<DriverService, WebDriverException>) service -> {
94+
throw serviceOptional.map(service -> {
9695
if (service.isRunning()) {
9796
return new WebDriverException("The session is closed!", rootCause);
9897
}

0 commit comments

Comments
 (0)