Skip to content

Commit b84ee71

Browse files
RenderMichaelgryznar
authored andcommitted
[dotnet] Annotate nullability on Domains (SeleniumHQ#15237)
1 parent 169af36 commit b84ee71

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

dotnet/src/webdriver/DevTools/DevToolsDomains.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public abstract class DevToolsDomains
8282
/// Initializes the supplied DevTools session's domains for the specified browser version.
8383
/// </summary>
8484
/// <param name="protocolVersion">The version of the DevTools Protocol to use.</param>
85-
/// <param name="session">The <see cref="DevToolsSession"/> for which to initialiize the domains.</param>
85+
/// <param name="session">The <see cref="DevToolsSession"/> for which to initialize the domains.</param>
8686
/// <returns>The <see cref="DevToolsDomains"/> object containing the version-specific domains.</returns>
8787
/// <exception cref="ArgumentException">If <paramref name="protocolVersion"/> is negative.</exception>
8888
/// <exception cref="WebDriverException">If the desired protocol version is not supported.</exception>
@@ -95,7 +95,7 @@ public static DevToolsDomains InitializeDomains(int protocolVersion, DevToolsSes
9595
/// Initializes the supplied DevTools session's domains for the specified browser version within the specified number of versions.
9696
/// </summary>
9797
/// <param name="protocolVersion">The version of the DevTools Protocol to use.</param>
98-
/// <param name="session">The <see cref="DevToolsSession"/> for which to initialiize the domains.</param>
98+
/// <param name="session">The <see cref="DevToolsSession"/> for which to initialize the domains.</param>
9999
/// <param name="versionRange">The range of versions within which to match the provided version number. Defaults to 5 versions.</param>
100100
/// <returns>The <see cref="DevToolsDomains"/> object containing the version-specific domains.</returns>
101101
/// <exception cref="ArgumentException">If <paramref name="protocolVersion"/> is negative.</exception>

dotnet/src/webdriver/DevTools/v130/V130Domains.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,27 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using System;
21+
22+
#nullable enable
23+
2024
namespace OpenQA.Selenium.DevTools.V130
2125
{
2226
/// <summary>
2327
/// Class containing the domain implementation for version 130 of the DevTools Protocol.
2428
/// </summary>
2529
public class V130Domains : DevToolsDomains
2630
{
27-
private DevToolsSessionDomains domains;
31+
private readonly DevToolsSessionDomains domains;
2832

2933
/// <summary>
3034
/// Initializes a new instance of the V130Domains class.
3135
/// </summary>
3236
/// <param name="session">The DevToolsSession to use with this set of domains.</param>
37+
/// <exception cref="ArgumentNullException">If <paramref name="session"/> is <see langword="null"/>.</exception>
3338
public V130Domains(DevToolsSession session)
3439
{
35-
this.domains = new DevToolsSessionDomains(session);
40+
this.domains = new DevToolsSessionDomains(session ?? throw new ArgumentNullException(nameof(session)));
3641
}
3742

3843
/// <summary>

dotnet/src/webdriver/DevTools/v131/V131Domains.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,27 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using System;
21+
22+
#nullable enable
23+
2024
namespace OpenQA.Selenium.DevTools.V131
2125
{
2226
/// <summary>
2327
/// Class containing the domain implementation for version 131 of the DevTools Protocol.
2428
/// </summary>
2529
public class V131Domains : DevToolsDomains
2630
{
27-
private DevToolsSessionDomains domains;
31+
private readonly DevToolsSessionDomains domains;
2832

2933
/// <summary>
3034
/// Initializes a new instance of the V131Domains class.
3135
/// </summary>
3236
/// <param name="session">The DevToolsSession to use with this set of domains.</param>
37+
/// <exception cref="ArgumentNullException">If <paramref name="session"/> is <see langword="null"/>.</exception>
3338
public V131Domains(DevToolsSession session)
3439
{
35-
this.domains = new DevToolsSessionDomains(session);
40+
this.domains = new DevToolsSessionDomains(session ?? throw new ArgumentNullException(nameof(session)));
3641
}
3742

3843
/// <summary>

dotnet/src/webdriver/DevTools/v132/V132Domains.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,27 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using System;
21+
22+
#nullable enable
23+
2024
namespace OpenQA.Selenium.DevTools.V132
2125
{
2226
/// <summary>
2327
/// Class containing the domain implementation for version 132 of the DevTools Protocol.
2428
/// </summary>
2529
public class V132Domains : DevToolsDomains
2630
{
27-
private DevToolsSessionDomains domains;
31+
private readonly DevToolsSessionDomains domains;
2832

2933
/// <summary>
3034
/// Initializes a new instance of the V132Domains class.
3135
/// </summary>
3236
/// <param name="session">The DevToolsSession to use with this set of domains.</param>
37+
/// <exception cref="ArgumentNullException">If <paramref name="session"/> is <see langword="null"/>.</exception>
3338
public V132Domains(DevToolsSession session)
3439
{
35-
this.domains = new DevToolsSessionDomains(session);
40+
this.domains = new DevToolsSessionDomains(session ?? throw new ArgumentNullException(nameof(session)));
3641
}
3742

3843
/// <summary>

dotnet/src/webdriver/DevTools/v85/V85Domains.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,27 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using System;
21+
22+
#nullable enable
23+
2024
namespace OpenQA.Selenium.DevTools.V85
2125
{
2226
/// <summary>
2327
/// Class containing the domain implementation for version 86 of the DevTools Protocol.
2428
/// </summary>
2529
public class V85Domains : DevToolsDomains
2630
{
27-
private DevToolsSessionDomains domains;
31+
private readonly DevToolsSessionDomains domains;
2832

2933
/// <summary>
3034
/// Initializes a new instance of the V85Domains class.
3135
/// </summary>
3236
/// <param name="session">The DevToolsSession to use with this set of domains.</param>
37+
/// <exception cref="ArgumentNullException">If <paramref name="session"/> is <see langword="null"/>.</exception>
3338
public V85Domains(DevToolsSession session)
3439
{
35-
this.domains = new DevToolsSessionDomains(session);
40+
this.domains = new DevToolsSessionDomains(session ?? throw new ArgumentNullException(nameof(session)));
3641
}
3742

3843
/// <summary>

0 commit comments

Comments
 (0)