-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[dotnet] Increment WebDriver
towards nullability
#15228
base: trunk
Are you sure you want to change the base?
[dotnet] Increment WebDriver
towards nullability
#15228
Conversation
PR Reviewer Guide 🔍(Review updated until commit 0226224)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 0226224
Previous suggestions✅ Suggestions up to commit 13d222a
|
dotnet/src/webdriver/WebDriver.cs
Outdated
@@ -129,7 +120,8 @@ public string Title | |||
get | |||
{ | |||
Response commandResponse = this.Execute(DriverCommand.GetTitle, null); | |||
object returnedTitle = commandResponse != null ? commandResponse.Value : string.Empty; | |||
object returnedTitle = commandResponse?.Value ?? string.Empty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commandResponse == null
is almost certainly unreachable code, but I will not rock this boat.
public Command(SessionId? sessionId, string name, Dictionary<string, object>? parameters) | ||
{ | ||
this.SessionId = sessionId; | ||
this.Parameters = parameters ?? new Dictionary<string, object>(); | ||
this.Name = name; | ||
this.Name = name ?? throw new ArgumentNullException(nameof(name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified that passing in null
for the name will throw an exception anyway, This just clarifies the exception for any user who does this.
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Increment
WebDriver
towards nullabilityMotivation and Context
Contributes to #14640
Types of changes
Checklist
PR Type
Enhancement, Bug fix
Description
Incrementally refactored
WebDriver
to support nullability annotations.Improved error handling with null checks and exceptions.
Enhanced code readability by simplifying property definitions.
Updated
WebElementFactory
methods to handle nullable dictionaries.Changes walkthrough 📝
WebDriver.cs
Refactored `WebDriver` for nullability and error handling
dotnet/src/webdriver/WebDriver.cs
WebElementFactory.cs
Enhanced `WebElementFactory` for nullability support
dotnet/src/webdriver/WebElementFactory.cs