3232import java .util .HashMap ;
3333import java .util .List ;
3434import java .util .Map ;
35+ import org .jspecify .annotations .Nullable ;
3536import org .openqa .selenium .Capabilities ;
3637import org .openqa .selenium .WebDriverException ;
3738import org .openqa .selenium .net .PortProber ;
@@ -64,11 +65,11 @@ public class SafariDriverService extends DriverService {
6465 * @throws IOException If an I/O error occurs.
6566 */
6667 public SafariDriverService (
67- File executable ,
68+ @ Nullable File executable ,
6869 int port ,
69- Duration timeout ,
70- List <String > args ,
71- Map <String , String > environment )
70+ @ Nullable Duration timeout ,
71+ @ Nullable List <String > args ,
72+ @ Nullable Map <String , String > environment )
7273 throws IOException {
7374 super (
7475 executable ,
@@ -126,7 +127,7 @@ protected void waitUntilAvailable() {
126127 public static class Builder
127128 extends DriverService .Builder <SafariDriverService , SafariDriverService .Builder > {
128129
129- private Boolean diagnose ;
130+ private @ Nullable Boolean diagnose ;
130131
131132 @ Override
132133 public int score (Capabilities capabilities ) {
@@ -139,13 +140,13 @@ public int score(Capabilities capabilities) {
139140 return score ;
140141 }
141142
142- public Builder withLogging (Boolean logging ) {
143+ public Builder withLogging (@ Nullable Boolean logging ) {
143144 this .diagnose = logging ;
144145 return this ;
145146 }
146147
147148 @ Override
148- public Builder withLogFile (File logFile ) {
149+ public Builder withLogFile (@ Nullable File logFile ) {
149150 throw new WebDriverException (
150151 "Can not set log location for Safari; use withLogging(true) and locate log in"
151152 + " ~/Library/Logs/com.apple.WebDriver/" );
@@ -169,7 +170,11 @@ protected List<String> createArgs() {
169170
170171 @ Override
171172 protected SafariDriverService createDriverService (
172- File exe , int port , Duration timeout , List <String > args , Map <String , String > environment ) {
173+ @ Nullable File exe ,
174+ int port ,
175+ @ Nullable Duration timeout ,
176+ @ Nullable List <String > args ,
177+ @ Nullable Map <String , String > environment ) {
173178 try {
174179 withLogOutput (OutputStream .nullOutputStream ());
175180 return new SafariDriverService (exe , port , timeout , args , environment );
0 commit comments