[java] Feat 14291/jspecify nullable annotation edge driver service by iampopovich ยท Pull Request #15972 ยท SeleniumHQ/selenium
User description
๐ Related Issues
fixes #14291
๐ฅ What does this PR do?
This pull request introduces changes to the EdgeDriverService and its parent class DriverService to improve nullability handling by adding @Nullable annotations to various parameters and fields. These changes enhance type safety and make the codebase more robust when dealing with potentially null values.
๐ง Implementation Notes
Nullability Enhancements in EdgeDriverService:
- Added
@Nullableannotations to parameters in theEdgeDriverServiceconstructor, includingFile executable,Duration timeout,List<String> args, andMap<String, String> environment. This ensures better handling of optional values during service creation. - Updated the
Builderclass fields (e.g.,disableBuildCheck,logLevel,allowedListIps) with@Nullableannotations to explicitly mark them as optional. - Modified methods in the
Builderclass, such aswithLoglevelandwithAllowedListIps, to include@Nullableannotations for their parameters, improving clarity about optional inputs. [1] [2] [3] - Adjusted the
createDriverServicemethod inEdgeDriverServiceto use@Nullableannotations for its parameters, aligning with the updated constructor.
Nullability Enhancements in DriverService:
- Added
@Nullableannotations to theDriverServiceconstructor parameters (File executable,Duration timeout,List<String> args, andMap<String, String> environment) to propagate nullability handling to the parent class.
๐ก Additional Considerations
๐ Types of changes
- Cleanup (formatting, renaming)
PR Type
Enhancement
Description
-
Add @nullable annotations to EdgeDriverService constructor parameters
-
Add @nullable annotations to Builder class fields and methods
-
Update DriverService constructor with @nullable annotations
-
Add jspecify dependency to BUILD.bazel
Changes diagram
flowchart LR
A["EdgeDriverService constructor"] -- "add @Nullable" --> B["Parameters: executable, timeout, args, environment"]
C["Builder class fields"] -- "add @Nullable" --> D["Fields: disableBuildCheck, logLevel, allowedListIps, etc."]
E["Builder methods"] -- "add @Nullable" --> F["Method parameters: withLoglevel, withAllowedListIps"]
G["BUILD.bazel"] -- "add dependency" --> H["org_jspecify_jspecify"]
Changes walkthrough ๐
| Relevant files | |||||
|---|---|---|---|---|---|
| Enhancement |
| ||||
| Dependencies |
|
Need help?
Type /help how to ...in the comments thread for any questions about Qodo Merge usage.Check out the documentation for more information.