File tree Expand file tree Collapse file tree 5 files changed +33
-13
lines changed
java/src/org/openqa/selenium Expand file tree Collapse file tree 5 files changed +33
-13
lines changed Original file line number Diff line number Diff line change 1717
1818package org .openqa .selenium ;
1919
20+ import org .jspecify .annotations .NullMarked ;
21+ import org .jspecify .annotations .Nullable ;
22+
2023/** Thrown by any command being called after {@link WebDriver#quit() WebDriver.quit()}. */
24+ @ NullMarked
2125public class NoSuchSessionException extends WebDriverException {
2226
2327 public NoSuchSessionException () {}
2428
25- public NoSuchSessionException (String reason ) {
29+ public NoSuchSessionException (@ Nullable String reason ) {
2630 super (reason );
2731 }
2832
29- public NoSuchSessionException (String reason , Throwable cause ) {
33+ public NoSuchSessionException (@ Nullable String reason , @ Nullable Throwable cause ) {
3034 super (reason , cause );
3135 }
3236}
Original file line number Diff line number Diff line change 1717
1818package org .openqa .selenium ;
1919
20+ import org .jspecify .annotations .NullMarked ;
21+ import org .jspecify .annotations .Nullable ;
22+
2023/** Thrown when an async execute script command does not complete in enough time. */
24+ @ NullMarked
2125public class ScriptTimeoutException extends WebDriverException {
2226
2327 public ScriptTimeoutException () {}
2428
25- public ScriptTimeoutException (String message ) {
29+ public ScriptTimeoutException (@ Nullable String message ) {
2630 super (message );
2731 }
2832
29- public ScriptTimeoutException (Throwable cause ) {
33+ public ScriptTimeoutException (@ Nullable Throwable cause ) {
3034 super (cause );
3135 }
3236
33- public ScriptTimeoutException (String message , Throwable cause ) {
37+ public ScriptTimeoutException (@ Nullable String message , @ Nullable Throwable cause ) {
3438 super (message , cause );
3539 }
3640}
Original file line number Diff line number Diff line change 1717
1818package org .openqa .selenium ;
1919
20+ import org .jspecify .annotations .NullMarked ;
21+ import org .jspecify .annotations .Nullable ;
22+
2023/** Indicates that a session could not be created. */
24+ @ NullMarked
2125public class SessionNotCreatedException extends WebDriverException {
22- public SessionNotCreatedException (String msg ) {
26+ public SessionNotCreatedException (@ Nullable String msg ) {
2327 super (
2428 "Could not start a new session. "
2529 + msg
2630 + (msg != null && msg .contains ("Host info" ) ? "" : " \n " + getHostInformation ()));
2731 }
2832
29- public SessionNotCreatedException (String msg , Throwable cause ) {
33+ public SessionNotCreatedException (@ Nullable String msg , @ Nullable Throwable cause ) {
3034 super (
3135 "Could not start a new session. "
3236 + msg
Original file line number Diff line number Diff line change 1717
1818package org .openqa .selenium ;
1919
20+ import org .jspecify .annotations .NullMarked ;
21+ import org .jspecify .annotations .Nullable ;
22+
2023/** Thrown when a command does not complete in enough time. */
24+ @ NullMarked
2125public class TimeoutException extends WebDriverException {
2226
2327 public TimeoutException () {}
2428
25- public TimeoutException (String message ) {
29+ public TimeoutException (@ Nullable String message ) {
2630 super (message );
2731 }
2832
29- public TimeoutException (Throwable cause ) {
33+ public TimeoutException (@ Nullable Throwable cause ) {
3034 super (cause );
3135 }
3236
33- public TimeoutException (String message , Throwable cause ) {
37+ public TimeoutException (@ Nullable String message , @ Nullable Throwable cause ) {
3438 super (message , cause );
3539 }
3640}
Original file line number Diff line number Diff line change 2020import java .util .Collections ;
2121import java .util .HashMap ;
2222import java .util .Map ;
23+ import org .jspecify .annotations .NullMarked ;
24+ import org .jspecify .annotations .Nullable ;
2325
26+ @ NullMarked
2427public class UnhandledAlertException extends WebDriverException {
2528
26- private final String alertText ;
29+ @ Nullable private final String alertText ;
2730
28- public UnhandledAlertException (String message ) {
31+ public UnhandledAlertException (@ Nullable String message ) {
2932 this (message , null );
3033 }
3134
32- public UnhandledAlertException (String message , String alertText ) {
35+ public UnhandledAlertException (@ Nullable String message , @ Nullable String alertText ) {
3336 super (message + ": " + alertText );
3437 this .alertText = alertText ;
3538 }
3639
3740 /**
3841 * @return the text of the unhandled alert.
3942 */
43+ @ Nullable
4044 public String getAlertText () {
4145 return alertText ;
4246 }
You can’t perform that action at this time.
0 commit comments