Skip to content

Commit 7ce6809

Browse files
committed
Rename Response local and parameter
1 parent 00fe634 commit 7ce6809

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

dotnet/src/webdriver/Response.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,66 +59,66 @@ public Response(SessionId sessionId)
5959
/// <summary>
6060
/// Returns a new <see cref="Response"/> from a JSON-encoded string.
6161
/// </summary>
62-
/// <param name="responseJson">The JSON string to deserialize into a <see cref="Response"/>.</param>
62+
/// <param name="value">The JSON string to deserialize into a <see cref="Response"/>.</param>
6363
/// <returns>A <see cref="Response"/> object described by the JSON string.</returns>
64-
public static Response FromJson(string responseJson)
64+
public static Response FromJson(string value)
6565
{
66-
Dictionary<string, object> rawResponse = JsonSerializer.Deserialize<Dictionary<string, object>>(responseJson, s_jsonSerializerOptions)
66+
Dictionary<string, object> rawResponse = JsonSerializer.Deserialize<Dictionary<string, object>>(value, s_jsonSerializerOptions)
6767
?? throw new WebDriverException("JSON success response returned \"null\" value");
6868

69-
var @this = new Response();
69+
var response = new Response();
7070

7171
if (rawResponse.ContainsKey("sessionId"))
7272
{
7373
if (rawResponse["sessionId"] != null)
7474
{
75-
@this.SessionId = rawResponse["sessionId"].ToString();
75+
response.SessionId = rawResponse["sessionId"].ToString();
7676
}
7777
}
7878

79-
if (rawResponse.TryGetValue("value", out object value))
79+
if (rawResponse.TryGetValue("value", out object valueObj))
8080
{
81-
@this.Value = value;
81+
response.Value = valueObj;
8282
}
8383

8484
// If the returned object does *not* have a "value" property
8585
// the response value should be the entirety of the response.
8686
// TODO: Remove this if statement altogether; there should
8787
// never be a spec-compliant response that does not contain a
8888
// value property.
89-
if (!rawResponse.ContainsKey("value") && @this.Value == null)
89+
if (!rawResponse.ContainsKey("value") && response.Value == null)
9090
{
9191
// Special-case for the new session command, where the "capabilities"
9292
// property of the response is the actual value we're interested in.
9393
if (rawResponse.ContainsKey("capabilities"))
9494
{
95-
@this.Value = rawResponse["capabilities"];
95+
response.Value = rawResponse["capabilities"];
9696
}
9797
else
9898
{
99-
@this.Value = rawResponse;
99+
response.Value = rawResponse;
100100
}
101101
}
102102

103-
if (@this.Value is Dictionary<string, object> valueDictionary)
103+
if (response.Value is Dictionary<string, object> valueDictionary)
104104
{
105105
// Special case code for the new session command. If the response contains
106106
// sessionId and capabilities properties, fix up the session ID and value members.
107107
if (valueDictionary.ContainsKey("sessionId"))
108108
{
109-
@this.SessionId = valueDictionary["sessionId"].ToString();
109+
response.SessionId = valueDictionary["sessionId"].ToString();
110110
if (valueDictionary.TryGetValue("capabilities", out object capabilities))
111111
{
112-
@this.Value = capabilities;
112+
response.Value = capabilities;
113113
}
114114
else
115115
{
116-
@this.Value = valueDictionary["value"];
116+
response.Value = valueDictionary["value"];
117117
}
118118
}
119119
}
120120

121-
return @this;
121+
return response;
122122
}
123123

124124
/// <summary>

0 commit comments

Comments
 (0)