You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🔧 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.
💡 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
flowchart LR
A["Exception Classes"] --> B["Add @NullMarked"]
A --> C["Add @Nullable to parameters"]
D["BUILD.bazel files"] --> E["Add jspecify dependency"]
B --> F["Enhanced null-safety"]
C --> F
E --> F
• Add JSpecify Nullness annotations to the Selenium framework code
• Specify which parameters and return values can be null using annotations
• Use @nullable annotation for parameters that can accept null values
Requires further human verification:
• Improve transparency to IDEs and static code analyzers
• Help developers avoid NullPointerExceptions
• Improve interoperability with Kotlin
The class only has @NullMarked annotation but no constructors are defined, which may not provide the expected null-safety benefits for exception instantiation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 classAdd null-safety annotations to constructorsAdd @NullMarked and @Nullable annotationsAdd null-safety annotations to constructorsAdd @NullMarked and @Nullable annotationsAdd null-safety annotations to constructor3 files
Add jspecify dependency to buildAdd jspecify dependency to buildAdd jspecify dependency to build