32
32
import java .util .HashMap ;
33
33
import java .util .List ;
34
34
import java .util .Map ;
35
+ import org .jspecify .annotations .Nullable ;
35
36
import org .openqa .selenium .Capabilities ;
36
37
import org .openqa .selenium .WebDriverException ;
37
38
import org .openqa .selenium .net .PortProber ;
@@ -64,11 +65,11 @@ public class SafariDriverService extends DriverService {
64
65
* @throws IOException If an I/O error occurs.
65
66
*/
66
67
public SafariDriverService (
67
- File executable ,
68
+ @ Nullable File executable ,
68
69
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 )
72
73
throws IOException {
73
74
super (
74
75
executable ,
@@ -126,7 +127,7 @@ protected void waitUntilAvailable() {
126
127
public static class Builder
127
128
extends DriverService .Builder <SafariDriverService , SafariDriverService .Builder > {
128
129
129
- private Boolean diagnose ;
130
+ private @ Nullable Boolean diagnose ;
130
131
131
132
@ Override
132
133
public int score (Capabilities capabilities ) {
@@ -139,13 +140,13 @@ public int score(Capabilities capabilities) {
139
140
return score ;
140
141
}
141
142
142
- public Builder withLogging (Boolean logging ) {
143
+ public Builder withLogging (@ Nullable Boolean logging ) {
143
144
this .diagnose = logging ;
144
145
return this ;
145
146
}
146
147
147
148
@ Override
148
- public Builder withLogFile (File logFile ) {
149
+ public Builder withLogFile (@ Nullable File logFile ) {
149
150
throw new WebDriverException (
150
151
"Can not set log location for Safari; use withLogging(true) and locate log in"
151
152
+ " ~/Library/Logs/com.apple.WebDriver/" );
@@ -169,7 +170,11 @@ protected List<String> createArgs() {
169
170
170
171
@ Override
171
172
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 ) {
173
178
try {
174
179
withLogOutput (OutputStream .nullOutputStream ());
175
180
return new SafariDriverService (exe , port , timeout , args , environment );
0 commit comments