Skip to content

Commit

Permalink
Fix SA1515/SA/1612/S2681 (#2018)
Browse files Browse the repository at this point in the history
  • Loading branch information
baranyaimate authored Mar 15, 2024
1 parent 0674bf8 commit 197cc16
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
12 changes: 6 additions & 6 deletions src/Polly/AsyncPolicy.ExecuteOverloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public Task ExecuteAsync(Func<Context, CancellationToken, Task> action, Context
/// Executes the specified asynchronous action within the policy.
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
public Task ExecuteAsync(Func<CancellationToken, Task> action, CancellationToken cancellationToken, bool continueOnCapturedContext) =>
Expand All @@ -87,8 +87,8 @@ public Task ExecuteAsync(Func<Context, CancellationToken, Task> action, IDiction
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
public async Task ExecuteAsync(Func<Context, CancellationToken, Task> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
Expand Down Expand Up @@ -180,8 +180,8 @@ public Task<TResult> ExecuteAsync<TResult>(Func<Context, CancellationToken, Task
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The value returned by the action.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
Expand All @@ -207,8 +207,8 @@ public Task<TResult> ExecuteAsync<TResult>(Func<Context, CancellationToken, Task
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The value returned by the action.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
Expand Down Expand Up @@ -325,8 +325,8 @@ public Task<PolicyResult> ExecuteAndCaptureAsync(Func<Context, CancellationToken
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
public async Task<PolicyResult> ExecuteAndCaptureAsync(Func<Context, CancellationToken, Task> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext)
Expand Down Expand Up @@ -435,8 +435,8 @@ public Task<PolicyResult<TResult>> ExecuteAndCaptureAsync<TResult>(Func<Cancella
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="contextData">Arbitrary data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The captured result.</returns>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="contextData"/> is <see langword="null"/>.</exception>
[DebuggerStepThrough]
Expand Down
10 changes: 5 additions & 5 deletions src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public Task<TResult> ExecuteAsync(Func<CancellationToken, Task<TResult>> action,
/// Executes the specified asynchronous action within the policy and returns the result.
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The value returned by the action.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
Expand Down Expand Up @@ -95,8 +95,8 @@ public Task<TResult> ExecuteAsync(Func<Context, CancellationToken, Task<TResult>
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The value returned by the action.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
Expand Down Expand Up @@ -165,8 +165,8 @@ public Task<PolicyResult<TResult>> ExecuteAndCaptureAsync(Func<CancellationToken
/// Executes the specified asynchronous action within the policy and returns the result.
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The captured result.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
Expand Down Expand Up @@ -201,8 +201,8 @@ public Task<PolicyResult<TResult>> ExecuteAndCaptureAsync(Func<Context, Cancella
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="contextData">Arbitrary data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The captured result.</returns>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="contextData"/> is <see langword="null"/>.</exception>
[DebuggerStepThrough]
Expand All @@ -214,8 +214,8 @@ public Task<PolicyResult<TResult>> ExecuteAndCaptureAsync(Func<Context, Cancella
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The captured result.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
[DebuggerStepThrough]
Expand Down
6 changes: 3 additions & 3 deletions src/Polly/IAsyncPolicy.TResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public interface IAsyncPolicy<TResult> : IsPolicy
/// Executes the specified asynchronous action within the policy and returns the result.
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The value returned by the action.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
Task<TResult> ExecuteAsync(Func<CancellationToken, Task<TResult>> action, CancellationToken cancellationToken, bool continueOnCapturedContext);
Expand All @@ -88,8 +88,8 @@ public interface IAsyncPolicy<TResult> : IsPolicy
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The value returned by the action.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
Task<TResult> ExecuteAsync(Func<Context, CancellationToken, Task<TResult>> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext);
Expand Down Expand Up @@ -160,8 +160,8 @@ public interface IAsyncPolicy<TResult> : IsPolicy
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="contextData">Arbitrary data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The captured result.</returns>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="contextData"/> is <see langword="null"/>.</exception>
Task<PolicyResult<TResult>> ExecuteAndCaptureAsync(Func<Context, CancellationToken, Task<TResult>> action, IDictionary<string, object> contextData, CancellationToken cancellationToken, bool continueOnCapturedContext);
Expand Down
12 changes: 6 additions & 6 deletions src/Polly/IAsyncPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public interface IAsyncPolicy : IsPolicy
/// Executes the specified asynchronous action within the policy.
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
Task ExecuteAsync(Func<CancellationToken, Task> action, CancellationToken cancellationToken, bool continueOnCapturedContext);

Expand All @@ -79,8 +79,8 @@ public interface IAsyncPolicy : IsPolicy
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
Task ExecuteAsync(Func<Context, CancellationToken, Task> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext);

Expand Down Expand Up @@ -142,8 +142,8 @@ public interface IAsyncPolicy : IsPolicy
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The value returned by the action.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
Task<TResult> ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>> action, CancellationToken cancellationToken, bool continueOnCapturedContext);
Expand All @@ -165,8 +165,8 @@ public interface IAsyncPolicy : IsPolicy
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy is in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The value returned by the action.</returns>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
Task<TResult> ExecuteAsync<TResult>(Func<Context, CancellationToken, Task<TResult>> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext);
Expand Down Expand Up @@ -245,8 +245,8 @@ public interface IAsyncPolicy : IsPolicy
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="context">Context data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <exception cref="InvalidOperationException">Please use asynchronous-defined policies when calling asynchronous ExecuteAsync (and similar) methods.</exception>
Task<PolicyResult> ExecuteAndCaptureAsync(Func<Context, CancellationToken, Task> action, Context context, CancellationToken cancellationToken, bool continueOnCapturedContext);

Expand Down Expand Up @@ -324,8 +324,8 @@ public interface IAsyncPolicy : IsPolicy
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="contextData">Arbitrary data that is passed to the exception policy.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="continueOnCapturedContext">Whether to continue on a captured synchronization context.</param>
/// <returns>The captured result.</returns>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="contextData"/> is <see langword="null"/>.</exception>
Task<PolicyResult<TResult>> ExecuteAndCaptureAsync<TResult>(Func<Context, CancellationToken, Task<TResult>> action, IDictionary<string, object> contextData, CancellationToken cancellationToken, bool continueOnCapturedContext);
Expand Down
Loading

0 comments on commit 197cc16

Please sign in to comment.