Skip to content

Commit 4e1dc66

Browse files
iampopovichdiemol
andauthored
[java] Add @nullable annotations to InternetExplorerDriverService parameters (#16001)
Add @nullable annotations to InternetExplorerDriverService parameters Co-authored-by: Diego Molina <[email protected]>
1 parent e2958fd commit 4e1dc66

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

java/src/org/openqa/selenium/ie/InternetExplorerDriverService.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.List;
3131
import java.util.Locale;
3232
import java.util.Map;
33+
import org.jspecify.annotations.Nullable;
3334
import org.openqa.selenium.Capabilities;
3435
import org.openqa.selenium.WebDriverException;
3536
import org.openqa.selenium.remote.service.DriverFinder;
@@ -78,11 +79,11 @@ public class InternetExplorerDriverService extends DriverService {
7879
* @throws IOException If an I/O error occurs.
7980
*/
8081
public InternetExplorerDriverService(
81-
File executable,
82+
@Nullable File executable,
8283
int port,
83-
Duration timeout,
84-
List<String> args,
85-
Map<String, String> environment)
84+
@Nullable Duration timeout,
85+
@Nullable List<String> args,
86+
@Nullable Map<String, String> environment)
8687
throws IOException {
8788
super(
8889
executable,
@@ -128,10 +129,10 @@ public static class Builder
128129
extends DriverService.Builder<
129130
InternetExplorerDriverService, InternetExplorerDriverService.Builder> {
130131

131-
private InternetExplorerDriverLogLevel logLevel;
132-
private String host = null;
133-
private File extractPath = null;
134-
private Boolean silent = null;
132+
private @Nullable InternetExplorerDriverLogLevel logLevel;
133+
private @Nullable String host = null;
134+
private @Nullable File extractPath = null;
135+
private @Nullable Boolean silent = null;
135136

136137
@Override
137138
public int score(Capabilities capabilities) {
@@ -154,7 +155,7 @@ public int score(Capabilities capabilities) {
154155
* @param logLevel A level of the log verbosity.
155156
* @return A self reference.
156157
*/
157-
public Builder withLogLevel(InternetExplorerDriverLogLevel logLevel) {
158+
public Builder withLogLevel(@Nullable InternetExplorerDriverLogLevel logLevel) {
158159
this.logLevel = logLevel;
159160
return this;
160161
}
@@ -165,7 +166,7 @@ public Builder withLogLevel(InternetExplorerDriverLogLevel logLevel) {
165166
* @param host A host name.
166167
* @return A self reference.
167168
*/
168-
public Builder withHost(String host) {
169+
public Builder withHost(@Nullable String host) {
169170
this.host = host;
170171
return this;
171172
}
@@ -176,7 +177,7 @@ public Builder withHost(String host) {
176177
* @param extractPath A path.
177178
* @return A self reference.
178179
*/
179-
public Builder withExtractPath(File extractPath) {
180+
public Builder withExtractPath(@Nullable File extractPath) {
180181
this.extractPath = extractPath;
181182
return this;
182183
}
@@ -187,7 +188,7 @@ public Builder withExtractPath(File extractPath) {
187188
* @param silent To be silent in stdout or not.
188189
* @return A self reference.
189190
*/
190-
public Builder withSilent(Boolean silent) {
191+
public Builder withSilent(@Nullable Boolean silent) {
191192
this.silent = silent;
192193
return this;
193194
}
@@ -244,7 +245,11 @@ protected List<String> createArgs() {
244245

245246
@Override
246247
protected InternetExplorerDriverService createDriverService(
247-
File exe, int port, Duration timeout, List<String> args, Map<String, String> environment) {
248+
@Nullable File exe,
249+
int port,
250+
@Nullable Duration timeout,
251+
@Nullable List<String> args,
252+
@Nullable Map<String, String> environment) {
248253
try {
249254
return new InternetExplorerDriverService(exe, port, timeout, args, environment);
250255
} catch (IOException e) {

0 commit comments

Comments
 (0)