Skip to content

Commit bf71403

Browse files
committed
[java] JSpecify annotations for ExecuteMethod
1 parent 17a5dba commit bf71403

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

java/src/org/openqa/selenium/remote/ExecuteMethod.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
package org.openqa.selenium.remote;
1919

2020
import java.util.Map;
21+
import org.jspecify.annotations.NullMarked;
22+
import org.jspecify.annotations.Nullable;
2123

2224
/**
2325
* An encapsulation of {@link org.openqa.selenium.remote.RemoteWebDriver#executeScript(String,
2426
* Object...)}.
2527
*/
28+
@NullMarked
2629
public interface ExecuteMethod {
2730
/**
2831
* Execute the given command on the remote webdriver server. Any exceptions will be thrown by the
@@ -32,5 +35,5 @@ public interface ExecuteMethod {
3235
* @param parameters The parameters to execute that command with
3336
* @return The result of {@link Response#getValue()}.
3437
*/
35-
Object execute(String commandName, Map<String, ?> parameters);
38+
Object execute(String commandName, @Nullable Map<String, ?> parameters);
3639
}

java/src/org/openqa/selenium/remote/RemoteExecuteMethod.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
package org.openqa.selenium.remote;
1919

2020
import java.util.Map;
21+
import org.jspecify.annotations.NullMarked;
22+
import org.jspecify.annotations.Nullable;
2123
import org.openqa.selenium.WebDriver;
2224
import org.openqa.selenium.WrapsDriver;
2325
import org.openqa.selenium.internal.Require;
2426

27+
@NullMarked
2528
public class RemoteExecuteMethod implements ExecuteMethod, WrapsDriver {
2629
private final RemoteWebDriver driver;
2730

@@ -30,7 +33,7 @@ public RemoteExecuteMethod(RemoteWebDriver driver) {
3033
}
3134

3235
@Override
33-
public Object execute(String commandName, Map<String, ?> parameters) {
36+
public Object execute(String commandName, @Nullable Map<String, ?> parameters) {
3437
Response response;
3538

3639
if (parameters == null || parameters.isEmpty()) {

0 commit comments

Comments
 (0)