[java] added jspecify annotations Nullable and NullMarked to exception classes
User description
🔗 Related Issues
partially fixes #14291
💥 What does this PR do?
This pull request adds annotations to classes that extend WebDriverException.
To make the changes easier to review, I have split the task of annotating all exception classes into several smaller pull requests. This PR contains updates for 5-7 classes.
🔧 Implementation Notes
This pull request introduces updates to exception classes in the Selenium Java package to improve null safety by integrating jspecify annotations. The changes include marking classes with @NullMarked and updating method parameters to use @Nullable where applicable.
💡 Additional Considerations
🔄 Types of changes
- Cleanup (formatting, renaming)
PR Type
Enhancement
Description
-
Add
@NullMarkedannotations to 7 exception classes -
Add
@Nullableannotations to constructor parameters -
Improve null safety with jspecify annotations
-
Part of larger effort to annotate all exception classes
Changes diagram
flowchart LR
A["Exception Classes"] --> B["Add @NullMarked"]
A --> C["Add @Nullable to parameters"]
B --> D["Improved null safety"]
C --> D
Changes walkthrough 📝
| Relevant files | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 7 files
|
Need help?
Type /help how to ...in the comments thread for any questions about Qodo Merge usage.Check out the documentation for more information.
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
| ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪ |
| 🧪 No relevant tests |
| 🔒 No security concerns identified |
⚡ Recommended focus areas for reviewMissing Annotation
|
PR Code Suggestions ✨
Explore these optional code suggestions:
| Category | Suggestion | Impact |
| General |
Add missing NullMarked annotationAdd the java/src/org/openqa/selenium/HealthCheckFailedException.java [20-23]
Suggestion importance[1-10]: 7__ Why: The suggestion correctly identifies that the | Medium |
| ||
@pujagani check please🙏