-
-
Couldn't load subscription status.
- Fork 8.6k
[java] Add JSpecify nullable annotations to SafariDriverService parameters #16000
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] Add JSpecify nullable annotations to SafariDriverService parameters #16000
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
…ari_driver_service
User description
🔗 Related Issues
fixes #14291
💥 What does this PR do?
🔧 Implementation Notes
This pull request introduces changes to the
SafariDriverServiceclass and its associated Bazel build file to improve nullability handling and enhance type safety using@Nullableannotations. These changes aim to make the codebase more robust and compatible with tools that rely on nullability annotations.Nullability Enhancements in
SafariDriverService:@Nullableannotations to method parameters: Updated multiple constructors and methods, includingcreateDriverService, to mark parameters likeFile,Duration,List<String>, andMap<String, String>as nullable, improving clarity and type safety. ([[1]](https://github.com/SeleniumHQ/selenium/pull/16000/files#diff-5ee8455f18e8d287ed7899d66b590a2e6e13197ef14f9a5213e830ff32d0d656L67-R72),[[2]](https://github.com/SeleniumHQ/selenium/pull/16000/files#diff-5ee8455f18e8d287ed7899d66b590a2e6e13197ef14f9a5213e830ff32d0d656L172-R177))@Nullableannotations to fields such asdiagnoseand methods likewithLoggingandwithLogFileto indicate optional values. ([[1]](https://github.com/SeleniumHQ/selenium/pull/16000/files#diff-5ee8455f18e8d287ed7899d66b590a2e6e13197ef14f9a5213e830ff32d0d656L129-R130),[[2]](https://github.com/SeleniumHQ/selenium/pull/16000/files#diff-5ee8455f18e8d287ed7899d66b590a2e6e13197ef14f9a5213e830ff32d0d656L142-R149))Build File Update:
@maven//:org_jspecify_jspecifydependency: Updated the Bazel build file to include theorg.jspecify.jspecifylibrary, enabling the use of@Nullableannotations in the project. ([java/src/org/openqa/selenium/safari/BUILD.bazelR17](https://github.com/SeleniumHQ/selenium/pull/16000/files#diff-0b0f5cc1965c89ca728657da296b7183ad9abed4555a906b6846798c506130a8R17))Import Statement Update:
@Nullableannotation: Addedorg.jspecify.annotations.Nullableto the imports inSafariDriverService.javato support nullability annotations. ([java/src/org/openqa/selenium/safari/SafariDriverService.javaR35](https://github.com/SeleniumHQ/selenium/pull/16000/files#diff-5ee8455f18e8d287ed7899d66b590a2e6e13197ef14f9a5213e830ff32d0d656R35))💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add
@Nullableannotations to SafariDriverService parametersEnhance type safety with JSpecify nullability annotations
Update Bazel build configuration for JSpecify dependency
Changes diagram
Changes walkthrough 📝
SafariDriverService.java
Add nullable annotations to parameters and fieldsjava/src/org/openqa/selenium/safari/SafariDriverService.java
@Nullableannotation from JSpecify@Nullableto constructor parameters (File, Duration, List, Map)@Nullableto Builder class fielddiagnose@Nullableto Builder methodswithLoggingandwithLogFileBUILD.bazel
Add JSpecify dependency to build configurationjava/src/org/openqa/selenium/safari/BUILD.bazel