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/chrome/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ java_export(
"//java/src/org/openqa/selenium/json",
"//java/src/org/openqa/selenium/manager",
"//java/src/org/openqa/selenium/remote",
"@maven//:org_jspecify_jspecify",
],
)
35 changes: 20 additions & 15 deletions java/src/org/openqa/selenium/chrome/ChromeDriverService.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import org.jspecify.annotations.Nullable;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.chromium.ChromiumDriverLogLevel;
Expand Down Expand Up @@ -102,11 +103,11 @@ public class ChromeDriverService extends DriverService {
* @throws IOException If an I/O error occurs.
*/
public ChromeDriverService(
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 @@ -151,13 +152,13 @@ public static ChromeDriverService createDefaultService() {
public static class Builder
extends DriverService.Builder<ChromeDriverService, ChromeDriverService.Builder> {

private Boolean disableBuildCheck;
private Boolean readableTimestamp;
private Boolean appendLog;
private Boolean verbose;
private Boolean silent;
private String allowedListIps;
private ChromiumDriverLogLevel logLevel;
private @Nullable Boolean disableBuildCheck;
private @Nullable Boolean readableTimestamp;
private @Nullable Boolean appendLog;
private @Nullable Boolean verbose;
private @Nullable Boolean silent;
private @Nullable String allowedListIps;
private @Nullable ChromiumDriverLogLevel logLevel;

@Override
public int score(Capabilities capabilities) {
Expand Down Expand Up @@ -202,7 +203,7 @@ public Builder withBuildCheckDisabled(boolean noBuildCheck) {
* @param logLevel {@link ChromiumDriverLogLevel} for desired log level output.
* @return A self reference.
*/
public Builder withLogLevel(ChromiumDriverLogLevel logLevel) {
public Builder withLogLevel(@Nullable ChromiumDriverLogLevel logLevel) {
this.logLevel = logLevel;
this.silent = false;
this.verbose = false;
Expand Down Expand Up @@ -244,7 +245,7 @@ public Builder withVerbose(boolean verbose) {
* @param allowedListIps Comma-separated list of remote IPv4 addresses.
* @return A self reference.
*/
public Builder withAllowedListIps(String allowedListIps) {
public Builder withAllowedListIps(@Nullable String allowedListIps) {
this.allowedListIps = allowedListIps;
return this;
}
Expand All @@ -255,7 +256,7 @@ public Builder withAllowedListIps(String allowedListIps) {
* @param readableTimestamp Whether the timestamp of the log is readable.
* @return A self reference.
*/
public Builder withReadableTimestamp(Boolean readableTimestamp) {
public Builder withReadableTimestamp(@Nullable Boolean readableTimestamp) {
this.readableTimestamp = readableTimestamp;
return this;
}
Expand Down Expand Up @@ -321,7 +322,11 @@ protected List<String> createArgs() {

@Override
protected ChromeDriverService 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 {
return new ChromeDriverService(exe, port, timeout, args, environment);
} catch (IOException e) {
Expand Down