diff --git a/java/src/org/openqa/selenium/DetachedShadowRootException.java b/java/src/org/openqa/selenium/DetachedShadowRootException.java index 2a74cf096e703..3494537d152fc 100644 --- a/java/src/org/openqa/selenium/DetachedShadowRootException.java +++ b/java/src/org/openqa/selenium/DetachedShadowRootException.java @@ -17,16 +17,20 @@ package org.openqa.selenium; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + /** * Indicates that a reference to a shadow root is now "detached" --- the element no longer appears * on the DOM of the page. */ +@NullMarked public class DetachedShadowRootException extends WebDriverException { - public DetachedShadowRootException(String message) { + public DetachedShadowRootException(@Nullable String message) { super(message); } - public DetachedShadowRootException(String message, Throwable cause) { + public DetachedShadowRootException(@Nullable String message, @Nullable Throwable cause) { super(message, cause); } } diff --git a/java/src/org/openqa/selenium/ElementClickInterceptedException.java b/java/src/org/openqa/selenium/ElementClickInterceptedException.java index a99e07d931e62..6dd0410576452 100644 --- a/java/src/org/openqa/selenium/ElementClickInterceptedException.java +++ b/java/src/org/openqa/selenium/ElementClickInterceptedException.java @@ -17,17 +17,21 @@ package org.openqa.selenium; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + /** * Indicates that a click could not be properly executed because the target element was obscured in * some way. */ +@NullMarked public class ElementClickInterceptedException extends ElementNotInteractableException { - public ElementClickInterceptedException(String message) { + public ElementClickInterceptedException(@Nullable String message) { super(message); } - public ElementClickInterceptedException(String message, Throwable cause) { + public ElementClickInterceptedException(@Nullable String message, @Nullable Throwable cause) { super(message, cause); } } diff --git a/java/src/org/openqa/selenium/HealthCheckFailedException.java b/java/src/org/openqa/selenium/HealthCheckFailedException.java index 270966659c995..54a24669d4ca5 100644 --- a/java/src/org/openqa/selenium/HealthCheckFailedException.java +++ b/java/src/org/openqa/selenium/HealthCheckFailedException.java @@ -17,10 +17,12 @@ package org.openqa.selenium; +import org.jspecify.annotations.Nullable; + /** Indicates that a Node health check failed. */ public class HealthCheckFailedException extends WebDriverException { - public HealthCheckFailedException(String msg, Throwable cause) { + public HealthCheckFailedException(@Nullable String msg, @Nullable Throwable cause) { super(msg, cause); } } diff --git a/java/src/org/openqa/selenium/InsecureCertificateException.java b/java/src/org/openqa/selenium/InsecureCertificateException.java index de92f3d68d15a..969e0c077e17f 100644 --- a/java/src/org/openqa/selenium/InsecureCertificateException.java +++ b/java/src/org/openqa/selenium/InsecureCertificateException.java @@ -17,20 +17,24 @@ package org.openqa.selenium; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + /** * Indicates that navigation caused by the user agent hit a certificate warning, which is usually * the result of an expired or invalid TLS certificate. */ +@NullMarked public class InsecureCertificateException extends WebDriverException { - public InsecureCertificateException(String message) { + public InsecureCertificateException(@Nullable String message) { super(message); } - public InsecureCertificateException(Throwable cause) { + public InsecureCertificateException(@Nullable Throwable cause) { super(cause); } - public InsecureCertificateException(String message, Throwable cause) { + public InsecureCertificateException(@Nullable String message, @Nullable Throwable cause) { super(message, cause); } } diff --git a/java/src/org/openqa/selenium/InvalidArgumentException.java b/java/src/org/openqa/selenium/InvalidArgumentException.java index 85fcf9d8e882d..62dfb3cd18340 100644 --- a/java/src/org/openqa/selenium/InvalidArgumentException.java +++ b/java/src/org/openqa/selenium/InvalidArgumentException.java @@ -17,12 +17,16 @@ package org.openqa.selenium; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + +@NullMarked public class InvalidArgumentException extends WebDriverException { - public InvalidArgumentException(String message) { + public InvalidArgumentException(@Nullable String message) { super(message); } - public InvalidArgumentException(String message, Throwable cause) { + public InvalidArgumentException(@Nullable String message, @Nullable Throwable cause) { super(message, cause); } } diff --git a/java/src/org/openqa/selenium/InvalidElementStateException.java b/java/src/org/openqa/selenium/InvalidElementStateException.java index bf8d6d523d7a1..3192a55c302f0 100644 --- a/java/src/org/openqa/selenium/InvalidElementStateException.java +++ b/java/src/org/openqa/selenium/InvalidElementStateException.java @@ -17,24 +17,28 @@ package org.openqa.selenium; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + /** * Indicates that a {@link WebElement} is in a state that means actions cannot be performed with it. * For example, attempting to clear an element that isn’t both editable and resettable. */ +@NullMarked public class InvalidElementStateException extends WebDriverException { public InvalidElementStateException() { super(); } - public InvalidElementStateException(String message) { + public InvalidElementStateException(@Nullable String message) { super(message); } - public InvalidElementStateException(Throwable cause) { + public InvalidElementStateException(@Nullable Throwable cause) { super(cause); } - public InvalidElementStateException(String message, Throwable cause) { + public InvalidElementStateException(@Nullable String message, @Nullable Throwable cause) { super(message, cause); } } diff --git a/java/src/org/openqa/selenium/UnsupportedCommandException.java b/java/src/org/openqa/selenium/UnsupportedCommandException.java index 72e53ecdc230b..66c985b3dff5f 100644 --- a/java/src/org/openqa/selenium/UnsupportedCommandException.java +++ b/java/src/org/openqa/selenium/UnsupportedCommandException.java @@ -17,22 +17,26 @@ package org.openqa.selenium; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + /** Used to indicate that a command used by the remote webdriver is unsupported. */ +@NullMarked public class UnsupportedCommandException extends WebDriverException { public UnsupportedCommandException() { super(); } - public UnsupportedCommandException(String message) { + public UnsupportedCommandException(@Nullable String message) { super(message); } - public UnsupportedCommandException(Throwable cause) { + public UnsupportedCommandException(@Nullable Throwable cause) { super(cause); } - public UnsupportedCommandException(String message, Throwable cause) { + public UnsupportedCommandException(@Nullable String message, @Nullable Throwable cause) { super(message, cause); } }