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 ide0002 style rule #2302

Merged
merged 1 commit into from
Sep 25, 2024
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
8 changes: 5 additions & 3 deletions src/Polly.Core/ResilienceValidationContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Polly;
using Polly.Utils;

namespace Polly;

/// <summary>
/// The validation context that encapsulates parameters for the validation.
Expand All @@ -12,8 +14,8 @@ internal sealed class ResilienceValidationContext
/// <param name="primaryMessage">The primary validation message.</param>
public ResilienceValidationContext(object instance, string primaryMessage)
{
Instance = Polly.Utils.Guard.NotNull(instance);
PrimaryMessage = Polly.Utils.Guard.NotNull(primaryMessage);
Instance = Guard.NotNull(instance);
PrimaryMessage = Guard.NotNull(primaryMessage);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Polly/AsyncPolicy.ExecuteOverloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ private async Task ExecuteInternalAsync(Func<Context, CancellationToken, Task> a
}
finally
{
PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
}
}

Expand All @@ -496,7 +496,7 @@ private async Task<TResult> ExecuteInternalAsync<TResult>(
}
finally
{
PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Polly/AsyncPolicy.TResult.ExecuteOverloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private async Task<TResult> ExecuteInternalAsync(
}
finally
{
PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Polly/Policy.ExecuteOverloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void Execute(Action<Context, CancellationToken> action, Context context,
}
finally
{
PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
}
}

Expand Down Expand Up @@ -160,7 +160,7 @@ public TResult Execute<TResult>(Func<Context, CancellationToken, TResult> action
}
finally
{
PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Polly/Policy.TResult.ExecuteOverloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public TResult Execute(Func<Context, CancellationToken, TResult> action, Context
}
finally
{
PolicyBase.RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
RestorePolicyContext(context, priorPolicyWrapKey, priorPolicyKey);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Polly/Utilities/TimedLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private sealed class Sentinel
// If this finalizer runs, someone somewhere failed to
// call Dispose, which means we've failed to leave
// a monitor!
System.Diagnostics.Debug.Fail("Undisposed lock");
Debug.Fail("Undisposed lock");
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/Snippets/Docs/ResiliencePipelines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static void ResiliencePipelinesDiagramTimeoutRetryTimeout()

public static async Task ExecuteOutcomeAsync()
{
var pipeline = Polly.ResiliencePipeline.Empty;
var pipeline = ResiliencePipeline.Empty;

#region resilience-pipeline-outcome

Expand Down