diff --git a/java/src/org/openqa/selenium/remote/ExecuteMethod.java b/java/src/org/openqa/selenium/remote/ExecuteMethod.java index b73eda1237991..de1caaefe8ca8 100644 --- a/java/src/org/openqa/selenium/remote/ExecuteMethod.java +++ b/java/src/org/openqa/selenium/remote/ExecuteMethod.java @@ -18,11 +18,14 @@ package org.openqa.selenium.remote; import java.util.Map; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; /** * An encapsulation of {@link org.openqa.selenium.remote.RemoteWebDriver#executeScript(String, * Object...)}. */ +@NullMarked public interface ExecuteMethod { /** * Execute the given command on the remote webdriver server. Any exceptions will be thrown by the @@ -32,5 +35,5 @@ public interface ExecuteMethod { * @param parameters The parameters to execute that command with * @return The result of {@link Response#getValue()}. */ - Object execute(String commandName, Map parameters); + @Nullable Object execute(String commandName, @Nullable Map parameters); } diff --git a/java/src/org/openqa/selenium/remote/RemoteExecuteMethod.java b/java/src/org/openqa/selenium/remote/RemoteExecuteMethod.java index 949429070aef1..381846faba6fb 100644 --- a/java/src/org/openqa/selenium/remote/RemoteExecuteMethod.java +++ b/java/src/org/openqa/selenium/remote/RemoteExecuteMethod.java @@ -18,10 +18,12 @@ package org.openqa.selenium.remote; import java.util.Map; +import org.jspecify.annotations.NullMarked; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WrapsDriver; import org.openqa.selenium.internal.Require; +@NullMarked public class RemoteExecuteMethod implements ExecuteMethod, WrapsDriver { private final RemoteWebDriver driver;