Skip to content

Commit 00bbb78

Browse files
committed
Address nullability feedback
Fixes #25275
1 parent 5297d5f commit 00bbb78

File tree

16 files changed

+49
-49
lines changed

16 files changed

+49
-49
lines changed

src/Components/Server/src/Circuits/CircuitIdFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public CircuitId CreateCircuitId()
4848
return new CircuitId(Base64UrlTextEncoder.Encode(secret), Base64UrlTextEncoder.Encode(id));
4949
}
5050

51-
public bool TryParseCircuitId(string text, out CircuitId circuitId)
51+
public bool TryParseCircuitId(string? text, out CircuitId circuitId)
5252
{
5353
if (text is null)
5454
{

src/Components/Server/src/Circuits/RemoteRenderer.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal class RemoteRenderer : Microsoft.AspNetCore.Components.RenderTree.Rende
2727
/// <summary>
2828
/// Notifies when a rendering exception occurred.
2929
/// </summary>
30-
public event EventHandler<Exception> UnhandledException;
30+
public event EventHandler<Exception>? UnhandledException;
3131

3232
/// <summary>
3333
/// Creates a new <see cref="RemoteRenderer"/>.
@@ -171,7 +171,7 @@ protected override Task UpdateDisplayAsync(in Microsoft.AspNetCore.Components.Re
171171
pendingRender = new UnacknowledgedRenderBatch(
172172
renderId,
173173
arrayBuilder,
174-
new TaskCompletionSource<object>(),
174+
new TaskCompletionSource(),
175175
ValueStopwatch.StartNew());
176176

177177
// Buffer the rendered batches no matter what. We'll send it down immediately when the client
@@ -234,7 +234,7 @@ private async Task WriteBatchBytesAsync(UnacknowledgedRenderBatch pending)
234234
// disposed.
235235
}
236236

237-
public Task OnRenderCompletedAsync(long incomingBatchId, string errorMessageOrNull)
237+
public Task OnRenderCompletedAsync(long incomingBatchId, string? errorMessageOrNull)
238238
{
239239
if (_disposing)
240240
{
@@ -308,7 +308,7 @@ public Task OnRenderCompletedAsync(long incomingBatchId, string errorMessageOrNu
308308
}
309309
}
310310

311-
private void ProcessPendingBatch(string errorMessageOrNull, UnacknowledgedRenderBatch entry)
311+
private void ProcessPendingBatch(string? errorMessageOrNull, UnacknowledgedRenderBatch entry)
312312
{
313313
var elapsedTime = entry.ValueStopwatch.GetElapsedTime();
314314
if (errorMessageOrNull == null)
@@ -324,11 +324,11 @@ private void ProcessPendingBatch(string errorMessageOrNull, UnacknowledgedRender
324324
CompleteRender(entry.CompletionSource, errorMessageOrNull);
325325
}
326326

327-
private void CompleteRender(TaskCompletionSource<object> pendingRenderInfo, string errorMessageOrNull)
327+
private void CompleteRender(TaskCompletionSource pendingRenderInfo, string? errorMessageOrNull)
328328
{
329329
if (errorMessageOrNull == null)
330330
{
331-
pendingRenderInfo.TrySetResult(null);
331+
pendingRenderInfo.TrySetResult();
332332
}
333333
else
334334
{
@@ -338,7 +338,7 @@ private void CompleteRender(TaskCompletionSource<object> pendingRenderInfo, stri
338338

339339
internal readonly struct UnacknowledgedRenderBatch
340340
{
341-
public UnacknowledgedRenderBatch(long batchId, ArrayBuilder<byte> data, TaskCompletionSource<object> completionSource, ValueStopwatch valueStopwatch)
341+
public UnacknowledgedRenderBatch(long batchId, ArrayBuilder<byte> data, TaskCompletionSource completionSource, ValueStopwatch valueStopwatch)
342342
{
343343
BatchId = batchId;
344344
Data = data;
@@ -348,7 +348,7 @@ public UnacknowledgedRenderBatch(long batchId, ArrayBuilder<byte> data, TaskComp
348348

349349
public long BatchId { get; }
350350
public ArrayBuilder<byte> Data { get; }
351-
public TaskCompletionSource<object> CompletionSource { get; }
351+
public TaskCompletionSource CompletionSource { get; }
352352
public ValueStopwatch ValueStopwatch { get; }
353353
}
354354

src/Components/Shared/src/ArrayBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree
1818
{
1919
/// <summary>
2020
/// Implements a list that uses an array of objects to store the elements.
21-
///
21+
///
2222
/// This differs from a <see cref="System.Collections.Generic.List{T}"/> in that
2323
/// it not only grows as required but also shrinks if cleared with significant
2424
/// excess capacity. This makes it useful for component rendering, because

src/DefaultBuilder/src/WebHost.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static class WebHost
3131
/// <param name="app">A delegate that handles requests to the application.</param>
3232
/// <returns>A started <see cref="IWebHost"/> that hosts the application.</returns>
3333
public static IWebHost Start(RequestDelegate app) =>
34-
Start(url: null, app: app);
34+
Start(url: null!, app: app);
3535

3636
/// <summary>
3737
/// Initializes and starts a new <see cref="IWebHost"/> with pre-configured defaults.
@@ -40,7 +40,7 @@ public static IWebHost Start(RequestDelegate app) =>
4040
/// <param name="url">The URL the hosted application will listen on.</param>
4141
/// <param name="app">A delegate that handles requests to the application.</param>
4242
/// <returns>A started <see cref="IWebHost"/> that hosts the application.</returns>
43-
public static IWebHost Start(string? url, RequestDelegate app)
43+
public static IWebHost Start(string url, RequestDelegate app)
4444
{
4545
var startupAssemblyName = app.GetMethodInfo().DeclaringType!.GetTypeInfo().Assembly.GetName().Name;
4646
return StartWith(url: url, configureServices: null, app: appBuilder => appBuilder.Run(app), applicationName: startupAssemblyName);
@@ -53,7 +53,7 @@ public static IWebHost Start(string? url, RequestDelegate app)
5353
/// <param name="routeBuilder">A delegate that configures the router for handling requests to the application.</param>
5454
/// <returns>A started <see cref="IWebHost"/> that hosts the application.</returns>
5555
public static IWebHost Start(Action<IRouteBuilder> routeBuilder) =>
56-
Start(url: null, routeBuilder: routeBuilder);
56+
Start(url: null!, routeBuilder: routeBuilder);
5757

5858
/// <summary>
5959
/// Initializes and starts a new <see cref="IWebHost"/> with pre-configured defaults.
@@ -62,7 +62,7 @@ public static IWebHost Start(Action<IRouteBuilder> routeBuilder) =>
6262
/// <param name="url">The URL the hosted application will listen on.</param>
6363
/// <param name="routeBuilder">A delegate that configures the router for handling requests to the application.</param>
6464
/// <returns>A started <see cref="IWebHost"/> that hosts the application.</returns>
65-
public static IWebHost Start(string? url, Action<IRouteBuilder> routeBuilder)
65+
public static IWebHost Start(string url, Action<IRouteBuilder> routeBuilder)
6666
{
6767
var startupAssemblyName = routeBuilder.GetMethodInfo().DeclaringType!.GetTypeInfo().Assembly.GetName().Name;
6868
return StartWith(url, services => services.AddRouting(), appBuilder => appBuilder.UseRouter(routeBuilder), applicationName: startupAssemblyName);
@@ -75,7 +75,7 @@ public static IWebHost Start(string? url, Action<IRouteBuilder> routeBuilder)
7575
/// <param name="app">The delegate that configures the <see cref="IApplicationBuilder"/>.</param>
7676
/// <returns>A started <see cref="IWebHost"/> that hosts the application.</returns>
7777
public static IWebHost StartWith(Action<IApplicationBuilder> app) =>
78-
StartWith(url: null, app: app);
78+
StartWith(url: null!, app: app);
7979

8080
/// <summary>
8181
/// Initializes and starts a new <see cref="IWebHost"/> with pre-configured defaults.
@@ -84,7 +84,7 @@ public static IWebHost StartWith(Action<IApplicationBuilder> app) =>
8484
/// <param name="url">The URL the hosted application will listen on.</param>
8585
/// <param name="app">The delegate that configures the <see cref="IApplicationBuilder"/>.</param>
8686
/// <returns>A started <see cref="IWebHost"/> that hosts the application.</returns>
87-
public static IWebHost StartWith(string? url, Action<IApplicationBuilder> app) =>
87+
public static IWebHost StartWith(string url, Action<IApplicationBuilder> app) =>
8888
StartWith(url: url, configureServices: null, app: app, applicationName: null);
8989

9090
private static IWebHost StartWith(string? url, Action<IServiceCollection>? configureServices, Action<IApplicationBuilder> app, string? applicationName)
@@ -132,7 +132,7 @@ private static IWebHost StartWith(string? url, Action<IServiceCollection>? confi
132132
/// </remarks>
133133
/// <returns>The initialized <see cref="IWebHostBuilder"/>.</returns>
134134
public static IWebHostBuilder CreateDefaultBuilder() =>
135-
CreateDefaultBuilder(args: null);
135+
CreateDefaultBuilder(args: null!);
136136

137137
/// <summary>
138138
/// Initializes a new instance of the <see cref="WebHostBuilder"/> class with pre-configured defaults.
@@ -153,7 +153,7 @@ public static IWebHostBuilder CreateDefaultBuilder() =>
153153
/// </remarks>
154154
/// <param name="args">The command line args.</param>
155155
/// <returns>The initialized <see cref="IWebHostBuilder"/>.</returns>
156-
public static IWebHostBuilder CreateDefaultBuilder(string[]? args)
156+
public static IWebHostBuilder CreateDefaultBuilder(string[] args)
157157
{
158158
var builder = new WebHostBuilder();
159159

src/Hosting/Server.Abstractions/src/IServerIntegratedAuth.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public interface IServerIntegratedAuth
1616
/// <summary>
1717
/// The name of the authentication scheme for the server authentication handler.
1818
/// </summary>
19-
string? AuthenticationScheme { get; }
19+
string AuthenticationScheme { get; }
2020
}
2121
}

src/Hosting/Server.Abstractions/src/ServerIntegratedAuth.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public class ServerIntegratedAuth : IServerIntegratedAuth
1616
/// <summary>
1717
/// The name of the authentication scheme for the server authentication handler.
1818
/// </summary>
19-
public string? AuthenticationScheme { get; set; }
19+
public string AuthenticationScheme { get; set; } = default!;
2020
}
2121
}

src/Http/Authentication.Abstractions/src/AuthenticateResult.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static AuthenticateResult NoResult()
9898
/// </summary>
9999
/// <param name="failure">The failure exception.</param>
100100
/// <returns>The result.</returns>
101-
public static AuthenticateResult Fail(Exception? failure)
101+
public static AuthenticateResult Fail(Exception failure)
102102
{
103103
return new AuthenticateResult() { Failure = failure };
104104
}
@@ -109,7 +109,7 @@ public static AuthenticateResult Fail(Exception? failure)
109109
/// <param name="failure">The failure exception.</param>
110110
/// <param name="properties">Additional state values for the authentication session.</param>
111111
/// <returns>The result.</returns>
112-
public static AuthenticateResult Fail(Exception? failure, AuthenticationProperties? properties)
112+
public static AuthenticateResult Fail(Exception failure, AuthenticationProperties? properties)
113113
{
114114
return new AuthenticateResult() { Failure = failure, Properties = properties };
115115
}
@@ -119,7 +119,7 @@ public static AuthenticateResult Fail(Exception? failure, AuthenticationProperti
119119
/// </summary>
120120
/// <param name="failureMessage">The failure message.</param>
121121
/// <returns>The result.</returns>
122-
public static AuthenticateResult Fail(string? failureMessage)
122+
public static AuthenticateResult Fail(string failureMessage)
123123
=> Fail(new Exception(failureMessage));
124124

125125
/// <summary>
@@ -128,7 +128,7 @@ public static AuthenticateResult Fail(string? failureMessage)
128128
/// <param name="failureMessage">The failure message.</param>
129129
/// <param name="properties">Additional state values for the authentication session.</param>
130130
/// <returns>The result.</returns>
131-
public static AuthenticateResult Fail(string? failureMessage, AuthenticationProperties? properties)
131+
public static AuthenticateResult Fail(string failureMessage, AuthenticationProperties? properties)
132132
=> Fail(new Exception(failureMessage), properties);
133133
}
134134
}

src/Http/Authentication.Abstractions/src/AuthenticationToken.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public class AuthenticationToken
1212
/// <summary>
1313
/// Name.
1414
/// </summary>
15-
public string? Name { get; set; }
15+
public string Name { get; set; } = default!;
1616

1717
/// <summary>
1818
/// Value.
1919
/// </summary>
20-
public string? Value { get; set; }
20+
public string Value { get; set; } = default!;
2121
}
2222
}

src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ public interface IJSInProcessRuntime : IJSRuntime
1515
/// <param name="identifier">An identifier for the function to invoke. For example, the value <c>"someScope.someFunction"</c> will invoke the function <c>window.someScope.someFunction</c>.</param>
1616
/// <param name="args">JSON-serializable arguments.</param>
1717
/// <returns>An instance of <typeparamref name="T"/> obtained by JSON-deserializing the return value.</returns>
18-
T Invoke<T>(string identifier, params object[] args);
18+
T Invoke<T>(string identifier, params object?[] args);
1919
}
2020
}

src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public abstract class JSInProcessRuntime : JSRuntime, IJSInProcessRuntime
1919
/// <param name="args">JSON-serializable arguments.</param>
2020
/// <returns>An instance of <typeparamref name="TValue"/> obtained by JSON-deserializing the return value.</returns>
2121
[return: MaybeNull]
22-
public TValue Invoke<TValue>(string identifier, params object[] args)
22+
public TValue Invoke<TValue>(string identifier, params object?[] args)
2323
{
2424
var resultJson = InvokeJS(identifier, JsonSerializer.Serialize(args, JsonSerializerOptions));
2525
if (resultJson is null)

0 commit comments

Comments
 (0)