- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.6k
 
[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
@Nullableannotations from thejspecifylibrary to improve nullability handling across the Selenium Java codebase. It also updates the Bazel build files to include thejspecifydependency. 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@Nullableannotations 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@Nullableannotations, clarifying that their return values can be null.java/src/org/openqa/selenium/remote/service/DriverService.java: Imported the@Nullableannotation from thejspecifylibrary.java/src/org/openqa/selenium/ie/InternetExplorerDriver.java: Imported the@Nullableannotation from thejspecifylibrary.Build File Modifications:
java/src/org/openqa/selenium/ie/BUILD.bazel: Added theorg_jspecify_jspecifydependency to thejava_exporttarget to integrate thejspecifylibrary.java/src/org/openqa/selenium/remote/BUILD.bazel: Added theorg.jspecify:jspecifyartifact to thejava_librarytarget to enable usage ofjspecifyannotations.🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add JSpecify
@Nullableannotations 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 parametersjava/src/org/openqa/selenium/ie/InternetExplorerDriver.java
@Nullableannotation@Nullableannotations to constructor parameters (service,options,clientConfig)DriverService.java
Add nullable annotations to method return typesjava/src/org/openqa/selenium/remote/service/DriverService.java
@Nullableannotation@Nullableannotations to method return types (getDriverName,getDriverProperty,getDriverExecutable)BUILD.bazel
Add JSpecify dependency to build filejava/src/org/openqa/selenium/ie/BUILD.bazel
BUILD.bazel
Add JSpecify dependency to build filejava/src/org/openqa/selenium/remote/BUILD.bazel