Skip to content

Commit f7cf7cf

Browse files
committed
aded jspecify annotations Nullable and NullMarked
1 parent 6c607a8 commit f7cf7cf

7 files changed

+42
-16
lines changed

java/src/org/openqa/selenium/DetachedShadowRootException.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@
1717

1818
package org.openqa.selenium;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
import org.jspecify.annotations.Nullable;
22+
2023
/**
2124
* Indicates that a reference to a shadow root is now "detached" --- the element no longer appears
2225
* on the DOM of the page.
2326
*/
27+
@NullMarked
2428
public class DetachedShadowRootException extends WebDriverException {
25-
public DetachedShadowRootException(String message) {
29+
public DetachedShadowRootException(@Nullable String message) {
2630
super(message);
2731
}
2832

29-
public DetachedShadowRootException(String message, Throwable cause) {
33+
public DetachedShadowRootException(@Nullable String message, @Nullable Throwable cause) {
3034
super(message, cause);
3135
}
3236
}

java/src/org/openqa/selenium/ElementClickInterceptedException.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@
1717

1818
package org.openqa.selenium;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
import org.jspecify.annotations.Nullable;
22+
2023
/**
2124
* Indicates that a click could not be properly executed because the target element was obscured in
2225
* some way.
2326
*/
27+
@NullMarked
2428
public class ElementClickInterceptedException extends ElementNotInteractableException {
2529

26-
public ElementClickInterceptedException(String message) {
30+
public ElementClickInterceptedException(@Nullable String message) {
2731
super(message);
2832
}
2933

30-
public ElementClickInterceptedException(String message, Throwable cause) {
34+
public ElementClickInterceptedException(@Nullable String message, @Nullable Throwable cause) {
3135
super(message, cause);
3236
}
3337
}

java/src/org/openqa/selenium/HealthCheckFailedException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717

1818
package org.openqa.selenium;
1919

20+
import org.jspecify.annotations.Nullable;
21+
2022
/** Indicates that a Node health check failed. */
2123
public class HealthCheckFailedException extends WebDriverException {
2224

23-
public HealthCheckFailedException(String msg, Throwable cause) {
25+
public HealthCheckFailedException(@Nullable String msg, @Nullable Throwable cause) {
2426
super(msg, cause);
2527
}
2628
}

java/src/org/openqa/selenium/InsecureCertificateException.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,24 @@
1717

1818
package org.openqa.selenium;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
import org.jspecify.annotations.Nullable;
22+
2023
/**
2124
* Indicates that navigation caused by the user agent hit a certificate warning, which is usually
2225
* the result of an expired or invalid TLS certificate.
2326
*/
27+
@NullMarked
2428
public class InsecureCertificateException extends WebDriverException {
25-
public InsecureCertificateException(String message) {
29+
public InsecureCertificateException(@Nullable String message) {
2630
super(message);
2731
}
2832

29-
public InsecureCertificateException(Throwable cause) {
33+
public InsecureCertificateException(@Nullable Throwable cause) {
3034
super(cause);
3135
}
3236

33-
public InsecureCertificateException(String message, Throwable cause) {
37+
public InsecureCertificateException(@Nullable String message, @Nullable Throwable cause) {
3438
super(message, cause);
3539
}
3640
}

java/src/org/openqa/selenium/InvalidArgumentException.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717

1818
package org.openqa.selenium;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
import org.jspecify.annotations.Nullable;
22+
23+
@NullMarked
2024
public class InvalidArgumentException extends WebDriverException {
21-
public InvalidArgumentException(String message) {
25+
public InvalidArgumentException(@Nullable String message) {
2226
super(message);
2327
}
2428

25-
public InvalidArgumentException(String message, Throwable cause) {
29+
public InvalidArgumentException(@Nullable String message, @Nullable Throwable cause) {
2630
super(message, cause);
2731
}
2832
}

java/src/org/openqa/selenium/InvalidElementStateException.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,28 @@
1717

1818
package org.openqa.selenium;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
import org.jspecify.annotations.Nullable;
22+
2023
/**
2124
* Indicates that a {@link WebElement} is in a state that means actions cannot be performed with it.
2225
* For example, attempting to clear an element that isn’t both editable and resettable.
2326
*/
27+
@NullMarked
2428
public class InvalidElementStateException extends WebDriverException {
2529
public InvalidElementStateException() {
2630
super();
2731
}
2832

29-
public InvalidElementStateException(String message) {
33+
public InvalidElementStateException(@Nullable String message) {
3034
super(message);
3135
}
3236

33-
public InvalidElementStateException(Throwable cause) {
37+
public InvalidElementStateException(@Nullable Throwable cause) {
3438
super(cause);
3539
}
3640

37-
public InvalidElementStateException(String message, Throwable cause) {
41+
public InvalidElementStateException(@Nullable String message, @Nullable Throwable cause) {
3842
super(message, cause);
3943
}
4044
}

java/src/org/openqa/selenium/UnsupportedCommandException.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,26 @@
1717

1818
package org.openqa.selenium;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
import org.jspecify.annotations.Nullable;
22+
2023
/** Used to indicate that a command used by the remote webdriver is unsupported. */
24+
@NullMarked
2125
public class UnsupportedCommandException extends WebDriverException {
2226

2327
public UnsupportedCommandException() {
2428
super();
2529
}
2630

27-
public UnsupportedCommandException(String message) {
31+
public UnsupportedCommandException(@Nullable String message) {
2832
super(message);
2933
}
3034

31-
public UnsupportedCommandException(Throwable cause) {
35+
public UnsupportedCommandException(@Nullable Throwable cause) {
3236
super(cause);
3337
}
3438

35-
public UnsupportedCommandException(String message, Throwable cause) {
39+
public UnsupportedCommandException(@Nullable String message, @Nullable Throwable cause) {
3640
super(message, cause);
3741
}
3842
}

0 commit comments

Comments
 (0)