-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] Add JSpecify nullable annotations to exception classes #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 #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
|
||||||||||||||||||
…ption-classes-pt3
…ption-classes-pt3
| ], | ||
| deps = [ | ||
| "//java/src/org/openqa/selenium:core", | ||
| "@maven//:org_jspecify_jspecify", |
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.
I think, it's better to use artifact("org.jspecify:jspecify"),
At the top, an "artifact" load will be required:
load("//java:defs.bzl", "artifact", "java_export")
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.
Maybe I'm wrong,
Were there problems with artifact("org.jspecify:jspecify"), here?
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
jspecifylibrary 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
jspecifynullness annotations:java/src/org/openqa/selenium/InvalidCookieDomainException.java: Added@NullMarkedto the class and@Nullableannotations to method parameters for constructors.java/src/org/openqa/selenium/UnableToSetCookieException.java: Applied@NullMarkedto the class and@Nullableto constructor parameters.java/src/org/openqa/selenium/devtools/DevToolsException.java: Introduced@NullMarkedfor the class and@Nullablefor constructor parameters, ensuring proper handling of nullable values.java/src/org/openqa/selenium/json/JsonException.java: Updated the class with@NullMarkedand added@Nullableannotations to constructor parameters.java/src/org/openqa/selenium/remote/ScreenshotException.java: Enhanced the class with@NullMarkedand applied@Nullableannotations 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 exceptionAdd JSpecify annotations to cookie exceptionAdd JSpecify annotations to DevTools exceptionAdd JSpecify annotations to JSON exceptionAdd JSpecify annotations to screenshot exception2 files
Add jspecify dependency to devtools buildAdd jspecify dependency to json build