-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[java] Feat 14291/jspecify nullable annotation #15924
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
[java] Feat 14291/jspecify nullable annotation #15924
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
… and DriverService
…ment for options, service, and clientConfig
…onal for null handling
User description
🔗 Related Issues
fixes #14291
💥 What does this PR do?
This pull request introduces the use of
@Nullable
annotations from thejspecify
library to improve nullability handling across the Selenium Java codebase. It also updates the Bazel build files to include thejspecify
dependency. The most important changes are grouped into updates to nullability handling and build file modifications.Nullability Handling Enhancements:
java/src/org/openqa/selenium/ie/InternetExplorerDriver.java
: Added@Nullable
annotations to the constructor parameters (InternetExplorerDriverService
,InternetExplorerOptions
, andClientConfig
) to explicitly indicate that these parameters can accept null values.java/src/org/openqa/selenium/remote/service/DriverService.java
: Updated several methods (getDriverName
,getDriverProperty
,getDriverExecutable
) to include@Nullable
annotations, clarifying that their return values can be null.java/src/org/openqa/selenium/remote/service/DriverService.java
: Imported the@Nullable
annotation from thejspecify
library.java/src/org/openqa/selenium/ie/InternetExplorerDriver.java
: Imported the@Nullable
annotation from thejspecify
library.Build File Modifications:
java/src/org/openqa/selenium/ie/BUILD.bazel
: Added theorg_jspecify_jspecify
dependency to thejava_export
target to integrate thejspecify
library.java/src/org/openqa/selenium/remote/BUILD.bazel
: Added theorg.jspecify:jspecify
artifact to thejava_library
target to enable usage ofjspecify
annotations.🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add JSpecify
@Nullable
annotations to improve nullability handlingUpdate InternetExplorerDriver constructor parameters with nullable annotations
Enhance DriverService methods with nullable return type annotations
Update Bazel build files to include JSpecify dependency
Changes walkthrough 📝
InternetExplorerDriver.java
Add nullable annotations to constructor parameters
java/src/org/openqa/selenium/ie/InternetExplorerDriver.java
@Nullable
annotation@Nullable
annotations to constructor parameters (service
,options
,clientConfig
)DriverService.java
Add nullable annotations to method return types
java/src/org/openqa/selenium/remote/service/DriverService.java
@Nullable
annotation@Nullable
annotations to method return types (getDriverName
,getDriverProperty
,getDriverExecutable
)BUILD.bazel
Add JSpecify dependency to build file
java/src/org/openqa/selenium/ie/BUILD.bazel
BUILD.bazel
Add JSpecify dependency to build file
java/src/org/openqa/selenium/remote/BUILD.bazel