Skip to content

Commit b7e2c59

Browse files
committed
Fix naming issues based on .editorconfig updates.
1 parent e3fb672 commit b7e2c59

42 files changed

Lines changed: 302 additions & 302 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bench/Autofac.BenchmarkProfiling/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private static void Main(string[] args)
8484

8585
// Workload method is generated differently when BenchmarkDotNet actually runs; we'll need to wrap it in the set of parameters.
8686
// It's way slower than they way they do it, but it should still give us good profiler results.
87-
void workloadAction(int repeat)
87+
void WorkloadAction(int repeat)
8888
{
8989
while (repeat > 0)
9090
{
@@ -96,13 +96,13 @@ void workloadAction(int repeat)
9696
setupAction.InvokeSingle();
9797

9898
// Warmup.
99-
workloadAction(100);
99+
WorkloadAction(100);
100100

101101
// Now start a new thread.
102102
var runThread = new Thread(new ThreadStart(() =>
103103
{
104104
// Do a lot.
105-
workloadAction(10000);
105+
WorkloadAction(10000);
106106
}))
107107
{
108108
Name = "Workload Thread"

src/Autofac/Builder/BuildCallbackManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ internal static class BuildCallbackManager
1212
{
1313
private const string BuildCallbacksExecutedKey = nameof(BuildCallbacksExecutedKey);
1414

15-
private static readonly TypedService CallbackServiceType = new(typeof(BuildCallbackService));
15+
private static readonly TypedService _callbackServiceType = new(typeof(BuildCallbackService));
1616

1717
/// <summary>
1818
/// Executes the newly-registered build callbacks for a given scope/container..
1919
/// </summary>
2020
/// <param name="scope">The new scope/container.</param>
2121
internal static void RunBuildCallbacks(ILifetimeScope scope)
2222
{
23-
var buildCallbackServices = scope.ComponentRegistry.ServiceRegistrationsFor(CallbackServiceType);
23+
var buildCallbackServices = scope.ComponentRegistry.ServiceRegistrationsFor(_callbackServiceType);
2424

2525
foreach (var srv in buildCallbackServices)
2626
{
@@ -30,7 +30,7 @@ internal static void RunBuildCallbacks(ILifetimeScope scope)
3030
continue;
3131
}
3232

33-
var request = new ResolveRequest(CallbackServiceType, srv, Enumerable.Empty<Parameter>());
33+
var request = new ResolveRequest(_callbackServiceType, srv, Enumerable.Empty<Parameter>());
3434
var component = (BuildCallbackService)scope.ResolveComponent(request);
3535
srv.Registration.Metadata[BuildCallbacksExecutedKey] = true;
3636

src/Autofac/Builder/ReflectionActivatorData.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace Autofac.Builder;
1111
/// </summary>
1212
public class ReflectionActivatorData
1313
{
14-
private static readonly IConstructorFinder DefaultConstructorFinder = new DefaultConstructorFinder();
15-
private static readonly IConstructorSelector DefaultConstructorSelector = new MostParametersConstructorSelector();
14+
private static readonly IConstructorFinder _defaultConstructorFinder = new DefaultConstructorFinder();
15+
private static readonly IConstructorSelector _defaultConstructorSelector = new MostParametersConstructorSelector();
1616

1717
private Type _implementer = default!;
1818
private IConstructorFinder _constructorFinder;
@@ -26,8 +26,8 @@ public ReflectionActivatorData(Type implementer)
2626
{
2727
ImplementationType = implementer;
2828

29-
_constructorFinder = DefaultConstructorFinder;
30-
_constructorSelector = DefaultConstructorSelector;
29+
_constructorFinder = _defaultConstructorFinder;
30+
_constructorSelector = _defaultConstructorSelector;
3131
}
3232

3333
/// <summary>

src/Autofac/Core/Activators/Reflection/AutowiringPropertyInjector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal static class AutowiringPropertyInjector
1717
/// </summary>
1818
internal const string InstanceTypeNamedParameter = "Autofac.AutowiringPropertyInjector.InstanceType";
1919

20-
private static readonly MethodInfo CallPropertySetterOpenGenericMethod =
20+
private static readonly MethodInfo _callPropertySetterOpenGenericMethod =
2121
typeof(AutowiringPropertyInjector).GetDeclaredMethod(nameof(CallPropertySetter));
2222

2323
/// <summary>
@@ -164,7 +164,7 @@ private static IEnumerable<PropertyInfo> GetInjectableProperties(Type instanceTy
164164

165165
// Create a delegate TDeclaringType -> { TDeclaringType.Property = TValue; }
166166
var propertySetterAsAction = setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(typeInput, parameterType));
167-
var callPropertySetterClosedGenericMethod = CallPropertySetterOpenGenericMethod.MakeGenericMethod(typeInput, parameterType);
167+
var callPropertySetterClosedGenericMethod = _callPropertySetterOpenGenericMethod.MakeGenericMethod(typeInput, parameterType);
168168
var callPropertySetterDelegate = callPropertySetterClosedGenericMethod.CreateDelegate<Action<object, object?>>(propertySetterAsAction);
169169

170170
return callPropertySetterDelegate;

src/Autofac/Core/Activators/Reflection/ConstructorBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Autofac.Core.Activators.Reflection;
1313
/// </summary>
1414
public class ConstructorBinder
1515
{
16-
private static readonly Func<ConstructorInfo, Func<object?[], object>> FactoryBuilder = GetConstructorInvoker;
16+
private static readonly Func<ConstructorInfo, Func<object?[], object>> _factoryBuilder = GetConstructorInvoker;
1717

1818
private readonly ParameterInfo[] _constructorArgs;
1919
private readonly Func<object?[], object>? _factory;
@@ -39,7 +39,7 @@ public ConstructorBinder(ConstructorInfo constructorInfo)
3939
var factoryCache = ReflectionCacheSet.Shared.Internal.ConstructorBinderFactory;
4040

4141
// Build the invoker.
42-
_factory = factoryCache.GetOrAdd(constructorInfo, FactoryBuilder);
42+
_factory = factoryCache.GetOrAdd(constructorInfo, _factoryBuilder);
4343
}
4444
}
4545

src/Autofac/Core/ImplicitRegistrationSource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Autofac.Core;
1313
/// </summary>
1414
public abstract class ImplicitRegistrationSource : IRegistrationSource
1515
{
16-
private static readonly MethodInfo CreateRegistrationMethod = typeof(ImplicitRegistrationSource).GetDeclaredMethod(nameof(CreateRegistration));
16+
private static readonly MethodInfo _createRegistrationMethod = typeof(ImplicitRegistrationSource).GetDeclaredMethod(nameof(CreateRegistration));
1717

1818
private readonly Type _type;
1919

@@ -69,7 +69,7 @@ public IEnumerable<IComponentRegistration> RegistrationsFor(Service service, Fun
6969

7070
var registrationCreator = methodCache.GetOrAdd(valueType, t =>
7171
{
72-
return CreateRegistrationMethod.MakeGenericMethod(t).CreateDelegate<RegistrationCreator>(this);
72+
return _createRegistrationMethod.MakeGenericMethod(t).CreateDelegate<RegistrationCreator>(this);
7373
});
7474

7575
return registrationAccessor(valueService)

src/Autofac/Core/ReflectionCacheSet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Autofac.Core;
1212
/// </summary>
1313
public sealed class ReflectionCacheSet
1414
{
15-
private static readonly object CacheAllocationLock = new();
15+
private static readonly object _cacheAllocationLock = new();
1616

1717
private static WeakReference<ReflectionCacheSet>? _sharedSet;
1818

@@ -42,7 +42,7 @@ public static ReflectionCacheSet Shared
4242
{
4343
if (!TryGetSharedCache(out var sharedCache))
4444
{
45-
lock (CacheAllocationLock)
45+
lock (_cacheAllocationLock)
4646
{
4747
// Check the cache again inside the lock, another thread may have updated it.
4848
if (!TryGetSharedCache(out sharedCache))

src/Autofac/Core/Registration/DefaultRegisteredServicesTracker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Autofac.Core.Registration;
1414
/// </summary>
1515
internal class DefaultRegisteredServicesTracker : Disposable, IRegisteredServicesTracker
1616
{
17-
private static readonly Func<Service, ServiceRegistrationInfo> RegInfoFactory = srv => new ServiceRegistrationInfo(srv);
17+
private static readonly Func<Service, ServiceRegistrationInfo> _regInfoFactory = srv => new ServiceRegistrationInfo(srv);
1818

1919
private readonly Func<Service, IEnumerable<ServiceRegistration>> _registrationAccessor;
2020

@@ -528,6 +528,6 @@ private void BeginServiceInfoInitialization(Service service, ServiceRegistration
528528
[MethodImpl(MethodImplOptions.AggressiveInlining)]
529529
private ServiceRegistrationInfo GetServiceInfo(Service service)
530530
{
531-
return _serviceInfo.GetOrAdd(service, RegInfoFactory);
531+
return _serviceInfo.GetOrAdd(service, _regInfoFactory);
532532
}
533533
}

src/Autofac/Core/Resolving/Pipeline/ResolvePipelineBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal class ResolvePipelineBuilder : IResolvePipelineBuilder, IEnumerable<IRe
3232
/// <summary>
3333
/// Termination action for the end of pipelines.
3434
/// </summary>
35-
private static readonly Action<ResolveRequestContext> TerminateAction = context => { };
35+
private static readonly Action<ResolveRequestContext> _terminateAction = context => { };
3636

3737
private MiddlewareDeclaration? _first;
3838
private MiddlewareDeclaration? _last;
@@ -207,7 +207,7 @@ private static ResolvePipeline BuildPipeline(MiddlewareDeclaration? lastDecl)
207207
{
208208
// When we build, we go through the set and construct a single call stack, starting from the end.
209209
var current = lastDecl;
210-
var currentInvoke = TerminateAction;
210+
var currentInvoke = _terminateAction;
211211

212212
Action<ResolveRequestContext> Chain(Action<ResolveRequestContext> next, IResolveMiddleware stage)
213213
{

src/Autofac/Diagnostics/DefaultDiagnosticTracer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class DefaultDiagnosticTracer : OperationDiagnosticTracerBase<string>
2626
{
2727
private const string RequestExceptionTraced = "__RequestException";
2828

29-
private static readonly string[] NewLineSplit = new[] { Environment.NewLine };
29+
private static readonly string[] _newLineSplit = new[] { Environment.NewLine };
3030

3131
private readonly ConcurrentDictionary<IResolveOperation, IndentingStringBuilder> _operationBuilders = new();
3232

@@ -273,7 +273,7 @@ public void AppendException(string message, Exception ex)
273273
AppendIndent();
274274
_builder.AppendLine(message);
275275

276-
var exceptionBody = ex.ToString().Split(NewLineSplit, StringSplitOptions.None);
276+
var exceptionBody = ex.ToString().Split(_newLineSplit, StringSplitOptions.None);
277277

278278
Indent();
279279

0 commit comments

Comments
 (0)