Skip to content
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

Fix SA1515/SA1612/S2681 #2018

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 abstract partial class AsyncPolicy : PolicyBase, IAsyncPolicy
/// 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 abstract partial class AsyncPolicy : PolicyBase, IAsyncPolicy
/// </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 async Task ExecuteAsync(Func<Context, CancellationToken, Task> action, Co
/// </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 async Task ExecuteAsync(Func<Context, CancellationToken, Task> action, Co
/// <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 async Task<TResult> ExecuteAsync<TResult>(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 async Task<PolicyResult> ExecuteAndCaptureAsync(Func<Context, Cancellatio
/// <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 abstract partial class AsyncPolicy<TResult> : IAsyncPolicy<TResult>
/// 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 abstract partial class AsyncPolicy<TResult> : IAsyncPolicy<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 async Task<TResult> ExecuteAsync(Func<Context, CancellationToken, Task<TR
/// 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 async Task<TResult> ExecuteAsync(Func<Context, CancellationToken, Task<TR
/// </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 async Task<TResult> ExecuteAsync(Func<Context, CancellationToken, Task<TR
/// </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