-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] Add JSpecify nullable annotations to exception classes pt2 #16025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
[java] Add JSpecify nullable annotations to exception classes pt2 #16025
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! @iampopovich
…ption-classes-pt2
…ption-classes-pt2
…ption-classes-pt2
User description
🔗 Related Issues
partially fixes #14291
💥 What does this PR do?
same as #16024
🔧 Implementation Notes
This pull request introduces nullability annotations to improve type safety and clarify the handling of nullable values in several exception classes within the Selenium Java codebase. The changes ensure that parameters and fields that can accept or return
nullare explicitly marked as nullable, while the classes themselves are marked as null-safe.Nullability Annotations Added to Exception Classes:
NoSuchSessionException:@NullMarkedannotation to the class.reasonparameter in constructors as@Nullable.ScriptTimeoutException:@NullMarkedannotation to the class.messageandcauseparameters in constructors as@Nullable.SessionNotCreatedException:@NullMarkedannotation to the class.msgandcauseparameters in constructors as@Nullable.TimeoutException:@NullMarkedannotation to the class.messageandcauseparameters in constructors as@Nullable.UnhandledAlertException:@NullMarkedannotation to the class.alertTextfield and themessageandalertTextparameters in constructors as@Nullable.getAlertTextmethod to return@Nullable.💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Added JSpecify nullability annotations to exception classes
Marked classes as
@NullMarkedfor null safetyAnnotated constructor parameters and fields as
@NullableEnhanced type safety for exception handling
Changes diagram
Changes walkthrough 📝
NoSuchSessionException.java
Added nullability annotations to NoSuchSessionExceptionjava/src/org/openqa/selenium/NoSuchSessionException.java
@NullMarkedclass annotationreasonconstructor parameters as@NullableScriptTimeoutException.java
Added nullability annotations to ScriptTimeoutExceptionjava/src/org/openqa/selenium/ScriptTimeoutException.java
@NullMarkedclass annotationmessageandcauseconstructor parameters as@NullableSessionNotCreatedException.java
Added nullability annotations to SessionNotCreatedExceptionjava/src/org/openqa/selenium/SessionNotCreatedException.java
@NullMarkedclass annotationmsgandcauseconstructor parameters as@NullableTimeoutException.java
Added nullability annotations to TimeoutExceptionjava/src/org/openqa/selenium/TimeoutException.java
@NullMarkedclass annotationmessageandcauseconstructor parameters as@NullableUnhandledAlertException.java
Added nullability annotations to UnhandledAlertExceptionjava/src/org/openqa/selenium/UnhandledAlertException.java
@NullMarkedclass annotationalertTextfield and constructor parameters as@NullablegetAlertTextmethod return type as@Nullable