Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions java/src/org/openqa/selenium/safari/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ java_export(
"//java:auto-service",
"//java/src/org/openqa/selenium:core",
"//java/src/org/openqa/selenium/remote",
"@maven//:org_jspecify_jspecify",
],
)
21 changes: 13 additions & 8 deletions java/src/org/openqa/selenium/safari/SafariDriverService.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jspecify.annotations.Nullable;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.net.PortProber;
Expand Down Expand Up @@ -64,11 +65,11 @@ public class SafariDriverService extends DriverService {
* @throws IOException If an I/O error occurs.
*/
public SafariDriverService(
File executable,
@Nullable File executable,
int port,
Duration timeout,
List<String> args,
Map<String, String> environment)
@Nullable Duration timeout,
@Nullable List<String> args,
@Nullable Map<String, String> environment)
throws IOException {
super(
executable,
Expand Down Expand Up @@ -126,7 +127,7 @@ protected void waitUntilAvailable() {
public static class Builder
extends DriverService.Builder<SafariDriverService, SafariDriverService.Builder> {

private Boolean diagnose;
private @Nullable Boolean diagnose;

@Override
public int score(Capabilities capabilities) {
Expand All @@ -139,13 +140,13 @@ public int score(Capabilities capabilities) {
return score;
}

public Builder withLogging(Boolean logging) {
public Builder withLogging(@Nullable Boolean logging) {
this.diagnose = logging;
return this;
}

@Override
public Builder withLogFile(File logFile) {
public Builder withLogFile(@Nullable File logFile) {
throw new WebDriverException(
"Can not set log location for Safari; use withLogging(true) and locate log in"
+ " ~/Library/Logs/com.apple.WebDriver/");
Expand All @@ -169,7 +170,11 @@ protected List<String> createArgs() {

@Override
protected SafariDriverService createDriverService(
File exe, int port, Duration timeout, List<String> args, Map<String, String> environment) {
@Nullable File exe,
int port,
@Nullable Duration timeout,
@Nullable List<String> args,
@Nullable Map<String, String> environment) {
try {
withLogOutput(OutputStream.nullOutputStream());
return new SafariDriverService(exe, port, timeout, args, environment);
Expand Down