-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[java] Add JSpecify nullable annotations to exception classes pt3 #16026
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 pt3 #16026
Conversation
PR Reviewer Guide 🔍(Review updated until commit 3b4cc24)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 3b4cc24
Previous suggestionsSuggestions up to commit 4cdd18a
|
User description
🔗 Related Issues
partially fixes #14291
💥 What does this PR do?
same as
#16024
#16025
🔧 Implementation Notes
This pull request introduces nullness annotations from the
jspecify
library to improve type safety in exception classes within the Selenium Java codebase. The changes ensure that method parameters and classes explicitly handle nullable values, reducing ambiguity and potential runtime errors.Addition of
jspecify
nullness annotations:java/src/org/openqa/selenium/InvalidCookieDomainException.java
: Added@NullMarked
to the class and@Nullable
annotations to method parameters for constructors.java/src/org/openqa/selenium/UnableToSetCookieException.java
: Applied@NullMarked
to the class and@Nullable
to constructor parameters.java/src/org/openqa/selenium/devtools/DevToolsException.java
: Introduced@NullMarked
for the class and@Nullable
for constructor parameters, ensuring proper handling of nullable values.java/src/org/openqa/selenium/json/JsonException.java
: Updated the class with@NullMarked
and added@Nullable
annotations to constructor parameters.java/src/org/openqa/selenium/remote/ScreenshotException.java
: Enhanced the class with@NullMarked
and applied@Nullable
annotations to constructor parameters.💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add JSpecify nullable annotations to exception classes
Improve type safety with @NullMarked and @nullable
Update build dependencies for jspecify library
Changes diagram
Changes walkthrough 📝
5 files
Add JSpecify annotations to cookie exception
Add JSpecify annotations to cookie exception
Add JSpecify annotations to DevTools exception
Add JSpecify annotations to JSON exception
Add JSpecify annotations to screenshot exception
2 files
Add jspecify dependency to devtools build
Add jspecify dependency to json build