-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] Add @Nullable annotations to InternetExplorerDriverService parameters #16001
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 @Nullable annotations to InternetExplorerDriverService parameters #16001
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
…plorer_driver_service
User description
🔗 Related Issues
fixes #14291
💥 What does this PR do?
🔧 Implementation Notes
This pull request introduces nullable annotations (
@Nullable) to theInternetExplorerDriverServiceclass and its nestedBuilderclass in order to improve type safety and clarify the handling of potentially null values. These changes ensure better compatibility with tools that analyze nullability and enhance code robustness.Enhancements to nullability:
@Nullableannotations to constructor parameters: Updated the constructor ofInternetExplorerDriverServiceto markFile,Duration,List<String>, andMap<String, String>parameters as nullable, reflecting their potential to hold null values. ([java/src/org/openqa/selenium/ie/InternetExplorerDriverService.javaL81-R86](https://github.com/SeleniumHQ/selenium/pull/16001/files#diff-617a4c6d0ef39b1c4febbc83065a223bcd42281a33498df32b5e3cef6cb71677L81-R86))Builderclass: Marked thelogLevel,host,extractPath, andsilentfields as nullable in theBuilderclass to align with their optional nature. ([java/src/org/openqa/selenium/ie/InternetExplorerDriverService.javaL131-R135](https://github.com/SeleniumHQ/selenium/pull/16001/files#diff-617a4c6d0ef39b1c4febbc83065a223bcd42281a33498df32b5e3cef6cb71677L131-R135))withLogLevel,withHost,withExtractPath, andwithSilentin theBuilderclass to accept nullable parameters, ensuring flexibility in their usage. ([[1]](https://github.com/SeleniumHQ/selenium/pull/16001/files#diff-617a4c6d0ef39b1c4febbc83065a223bcd42281a33498df32b5e3cef6cb71677L157-R158),[[2]](https://github.com/SeleniumHQ/selenium/pull/16001/files#diff-617a4c6d0ef39b1c4febbc83065a223bcd42281a33498df32b5e3cef6cb71677L168-R169),[[3]](https://github.com/SeleniumHQ/selenium/pull/16001/files#diff-617a4c6d0ef39b1c4febbc83065a223bcd42281a33498df32b5e3cef6cb71677L179-R180),[[4]](https://github.com/SeleniumHQ/selenium/pull/16001/files#diff-617a4c6d0ef39b1c4febbc83065a223bcd42281a33498df32b5e3cef6cb71677L190-R191))createDriverServicemethod: Added@Nullableannotations to parameters of thecreateDriverServicemethod to account for cases where null values might be passed. ([java/src/org/openqa/selenium/ie/InternetExplorerDriverService.javaL247-R252](https://github.com/SeleniumHQ/selenium/pull/16001/files#diff-617a4c6d0ef39b1c4febbc83065a223bcd42281a33498df32b5e3cef6cb71677L247-R252))General improvements:
@Nullableannotation: Added theorg.jspecify.annotations.Nullableimport to enable the use of nullable annotations throughout the class. ([java/src/org/openqa/selenium/ie/InternetExplorerDriverService.javaR33](https://github.com/SeleniumHQ/selenium/pull/16001/files#diff-617a4c6d0ef39b1c4febbc83065a223bcd42281a33498df32b5e3cef6cb71677R33))💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add
@Nullableannotations to InternetExplorerDriverService constructor parametersMark Builder class fields as nullable for type safety
Update method parameters with nullable annotations
Import JSpecify annotations for better null handling
Changes diagram
Changes walkthrough 📝
InternetExplorerDriverService.java
Add nullable annotations for type safetyjava/src/org/openqa/selenium/ie/InternetExplorerDriverService.java
@Nullableannotation@Nullableto constructor parameters (executable, timeout, args,environment)
silent)
@Nullableannotations