From 168cf7af41a9c7685d999a4301d0ef79252b134b Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Sat, 27 Sep 2025 21:12:52 +0700 Subject: [PATCH 1/3] Add nullability annotations to ExecuteMethod interface parameters --- java/src/org/openqa/selenium/remote/ExecuteMethod.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/src/org/openqa/selenium/remote/ExecuteMethod.java b/java/src/org/openqa/selenium/remote/ExecuteMethod.java index b73eda1237991..e94412f683fbd 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,6 @@ 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); + } From 23893fb89a4fdfe68a409cf07d1bb2968145dd27 Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Sat, 27 Sep 2025 21:16:21 +0700 Subject: [PATCH 2/3] Add nullability annotations to RemoteExecuteMethod class --- java/src/org/openqa/selenium/remote/RemoteExecuteMethod.java | 2 ++ 1 file changed, 2 insertions(+) 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; From 3bc24e1efdb1ee82119c7f84f06b3c1e70e204b0 Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Sat, 27 Sep 2025 21:35:58 +0700 Subject: [PATCH 3/3] Remove unnecessary blank line in ExecuteMethod interface --- java/src/org/openqa/selenium/remote/ExecuteMethod.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/src/org/openqa/selenium/remote/ExecuteMethod.java b/java/src/org/openqa/selenium/remote/ExecuteMethod.java index e94412f683fbd..de1caaefe8ca8 100644 --- a/java/src/org/openqa/selenium/remote/ExecuteMethod.java +++ b/java/src/org/openqa/selenium/remote/ExecuteMethod.java @@ -36,5 +36,4 @@ public interface ExecuteMethod { * @return The result of {@link Response#getValue()}. */ @Nullable Object execute(String commandName, @Nullable Map parameters); - }