[java] Feat 14291/add jspecify annotations to exception classes pt4 #16028
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
partially fixes #14291
💥 What does this PR do?
same as
#16024
#16025
#16026
🔧 Implementation Notes
This pull request introduces updates to several exception classes across the Selenium codebase to improve null-safety and enhance clarity. The changes primarily involve adding @NullMarked annotations to the classes and @nullable annotations to method parameters where applicable.
Null-safety improvements:
java/src/org/openqa/selenium/devtools/RequestFailedException.java: Added @NullMarked annotation to the class to enforce null-safety.
java/src/org/openqa/selenium/grid/sessionmap/jdbc/JdbcException.java: Added @NullMarked annotation to the class and @nullable annotations to method parameters (message and cause) to handle potential null values.
java/src/org/openqa/selenium/remote/NoSuchDriverException.java: Added @NullMarked annotation to the class and updated constructors to include @nullable annotations for reason and cause parameters.
java/src/org/openqa/selenium/remote/UnreachableBrowserException.java: Added @NullMarked annotation to the class and updated constructors with @nullable annotations for message and cause parameters.
💡 Additional Considerations
🔄 Types of changes
Cleanup (formatting, renaming)
PR Type
Enhancement
Description
Add JSpecify null-safety annotations to exception classes
Include @NullMarked and @nullable annotations for better IDE support
Update build dependencies to include jspecify library
Improve Kotlin interoperability and static analysis
Changes diagram
Changes walkthrough 📝
6 files
Add @NullMarked annotation to class
Add null-safety annotations to constructors
Add @NullMarked and @Nullable annotations
Add null-safety annotations to constructors
Add @NullMarked and @Nullable annotations
Add null-safety annotations to constructor
3 files
Add jspecify dependency to build
Add jspecify dependency to build
Add jspecify dependency to build