Skip to content

Commit

Permalink
Address all IDE0040 warnings. Explicitly provide access modifiers. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist authored Sep 1, 2023
1 parent f845106 commit 163b935
Show file tree
Hide file tree
Showing 39 changed files with 80 additions and 84 deletions.
2 changes: 1 addition & 1 deletion src/AdoNet/Shared/Storage/DbExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal static class DbExtensions
/// <summary>
/// An explicit map of type CLR viz database type conversions.
/// </summary>
static readonly ReadOnlyDictionary<Type, DbType> typeMap = new ReadOnlyDictionary<Type, DbType>(new Dictionary<Type, DbType>
private static readonly ReadOnlyDictionary<Type, DbType> typeMap = new ReadOnlyDictionary<Type, DbType>(new Dictionary<Type, DbType>
{
{ typeof(object), DbType.Object },
{ typeof(int), DbType.Int32 },
Expand Down
2 changes: 1 addition & 1 deletion src/Orleans.Core/GrainDirectory/IDhtGrainDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Orleans.GrainDirectory
/// The methods here can be called remotely (where extended by IRemoteGrainDirectory) or
/// locally (where extended by ILocalGrainDirectory)
/// </summary>
interface IDhtGrainDirectory
internal interface IDhtGrainDirectory
{
/// <summary>
/// Record a new grain activation by adding it to the directory.
Expand Down
14 changes: 6 additions & 8 deletions src/Orleans.EventSourcing/LogStorage/LogViewAdaptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,15 @@ public LogViewAdaptor(ILogViewAdaptorHost<TLogView, TLogEntry> host, TLogView in


private const int maxEntriesInNotifications = 200;


readonly IGrainStorage globalGrainStorage;
readonly string grainTypeName;
private readonly IGrainStorage globalGrainStorage;
private readonly string grainTypeName;

// the object containing the entire log, as retrieved from / sent to storage
LogStateWithMetaDataAndETag<TLogEntry> GlobalLog;
private LogStateWithMetaDataAndETag<TLogEntry> GlobalLog;

// the confirmed view
TLogView ConfirmedViewInternal;
int ConfirmedVersionInternal;
private TLogView ConfirmedViewInternal;
private int ConfirmedVersionInternal;

/// <inheritdoc/>
protected override TLogView LastConfirmedView()
Expand Down Expand Up @@ -349,7 +347,7 @@ protected override void ProcessNotifications()


#if DEBUG
bool operation_in_progress;
private bool operation_in_progress;
#endif

[Conditional("DEBUG")]
Expand Down
10 changes: 4 additions & 6 deletions src/Orleans.EventSourcing/StateStorage/LogViewAdaptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ public LogViewAdaptor(ILogViewAdaptorHost<TLogView, TLogEntry> host, TLogView in


private const int maxEntriesInNotifications = 200;


readonly IGrainStorage globalGrainStorage;
readonly string grainTypeName; // stores the confirmed state including metadata
GrainStateWithMetaDataAndETag<TLogView> GlobalStateCache;
private readonly IGrainStorage globalGrainStorage;
private readonly string grainTypeName; // stores the confirmed state including metadata
private GrainStateWithMetaDataAndETag<TLogView> GlobalStateCache;

/// <inheritdoc/>
protected override TLogView LastConfirmedView()
Expand Down Expand Up @@ -326,7 +324,7 @@ protected override void ProcessNotifications()


#if DEBUG
bool operation_in_progress;
private bool operation_in_progress;
#endif

[Conditional("DEBUG")]
Expand Down
2 changes: 1 addition & 1 deletion src/Orleans.Streaming/Generator/GeneratorAdapterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public Task<object> ExecuteCommand(int command, object arg)

private class Receiver : IQueueAdapterReceiver
{
const int MaxDelayMs = 20;
private const int MaxDelayMs = 20;
private readonly IQueueAdapterReceiverMonitor receiverMonitor;
public IStreamGenerator QueueGenerator { private get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/Orleans.TestingHost/Utils/AsyncResultHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Orleans.TestingHost.Utils
/// </summary>
public class AsyncResultHandle
{
bool done = false;
bool continueFlag = false;
private bool done = false;
private bool continueFlag = false;

/// <summary> Reset the current result handle </summary>
public virtual void Reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface IRemoteCommitService
// - can produce errors for fault senarios.
public class RemoteCommitService : IRemoteCommitService
{
readonly ILogger logger;
private readonly ILogger logger;

public RemoteCommitService(ILogger<RemoteCommitService> logger)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Analyzers.Tests;
[TestCategory("BVT"), TestCategory("Analyzer")]
public class AbstractPropertiesCannotBeSerializedAnalyzerTest : DiagnosticAnalyzerTestBase<AbstractPropertiesCannotBeSerializedAnalyzer>
{
async Task VerifyGeneratedDiagnostic(string code)
private async Task VerifyGeneratedDiagnostic(string code)
{
var (diagnostics, _) = await GetDiagnosticsAsync(code, new string[0]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Analyzers.Tests;
[TestCategory("BVT"), TestCategory("Analyzer")]
public class GenerateGenerateSerializerAttributeAnalyzerTest : DiagnosticAnalyzerTestBase<GenerateGenerateSerializerAttributeAnalyzer>
{
async Task VerifyGeneratedDiagnostic(string code)
private async Task VerifyGeneratedDiagnostic(string code)
{
var (diagnostics, _) = await GetDiagnosticsAsync(code, new string[0]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Analyzers.Tests;
[TestCategory("BVT"), TestCategory("Analyzer")]
public class GenerateSerializationAttributesAnalyzerTest : DiagnosticAnalyzerTestBase<GenerateSerializationAttributesAnalyzer>
{
async Task VerifyGeneratedDiagnostic(string code)
private async Task VerifyGeneratedDiagnostic(string code)
{
var (diagnostics, _) = await GetDiagnosticsAsync(code, new string[0]);

Expand Down
2 changes: 1 addition & 1 deletion test/Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Benchmarks
{
class Program
internal class Program
{
private static readonly Dictionary<string, Action<string[]>> _benchmarks = new Dictionary<string, Action<string[]>>
{
Expand Down
2 changes: 1 addition & 1 deletion test/DefaultCluster.Tests/ClientAddressableTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void VerifyNumbers(int iterationCount)

private class MyProducer : IClientAddressableTestProducer
{
int counter = 0;
private int counter = 0;

public Task<int> Poll()
{
Expand Down
5 changes: 2 additions & 3 deletions test/DefaultCluster.Tests/EchoTaskGrainTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ namespace DefaultCluster.Tests.General
public class EchoTaskGrainTests : HostedTestClusterEnsureDefaultStarted
{
private readonly TimeSpan timeout = Debugger.IsAttached ? TimeSpan.FromMinutes(10) : TimeSpan.FromSeconds(10);

const string expectedEcho = "Hello from EchoGrain";
const string expectedEchoError = "Error from EchoGrain";
private const string expectedEcho = "Hello from EchoGrain";
private const string expectedEchoError = "Error from EchoGrain";
private IEchoTaskGrain grain;

public static readonly TimeSpan Epsilon = TimeSpan.FromSeconds(1);
Expand Down
2 changes: 1 addition & 1 deletion test/DefaultCluster.Tests/GenericGrainTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ public GenericEdgeCaseTests(DefaultClusterFixture fixture) : base(fixture)
{
}

static async Task<Type[]> GetConcreteGenArgs(IBasicGrain @this) {
private static async Task<Type[]> GetConcreteGenArgs(IBasicGrain @this) {
var genArgTypeNames = await @this.ConcreteGenArgTypeNames();

return genArgTypeNames.Select(n => Type.GetType(n))
Expand Down
4 changes: 2 additions & 2 deletions test/DefaultCluster.Tests/LocalErrorGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{
internal class LocalErrorGrain
{
int m_a = 0;
int m_b = 0;
private int m_a = 0;
private int m_b = 0;

public LocalErrorGrain() { }

Expand Down
7 changes: 4 additions & 3 deletions test/DefaultCluster.Tests/MultifacetGrainTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ namespace DefaultCluster.Tests.General
//using ValueUpdateEventArgs = MultifacetGrainClient.ValueUpdateEventArgs;
public class MultifacetGrainTest : HostedTestClusterEnsureDefaultStarted
{
IMultifacetWriter writer;
IMultifacetReader reader;
private IMultifacetWriter writer;
private IMultifacetReader reader;

//int eventCounter;
const int EXPECTED_NUMBER_OF_EVENTS = 4;
private const int EXPECTED_NUMBER_OF_EVENTS = 4;
private readonly TimeSpan timeout = TimeSpan.FromSeconds(5);

public MultifacetGrainTest(DefaultClusterFixture fixture) : base(fixture)
Expand Down
14 changes: 7 additions & 7 deletions test/DefaultCluster.Tests/ObserverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public async Task ObserverTest_SimpleNotification_GeneratedFactory()
this.GrainFactory.DeleteObjectReference<ISimpleGrainObserver>(reference);
}

void ObserverTest_SimpleNotification_Callback(int a, int b, AsyncResultHandle result)
private void ObserverTest_SimpleNotification_Callback(int a, int b, AsyncResultHandle result)
{
callbackCounter++;
this.Logger.LogInformation("Invoking ObserverTest_SimpleNotification_Callback for {CallbackCounter} time with a = {A} and b = {B}", this.callbackCounter, a, b);
Expand Down Expand Up @@ -142,7 +142,7 @@ public async Task ObserverTest_DoubleSubscriptionSameReference()
this.GrainFactory.DeleteObjectReference<ISimpleGrainObserver>(reference);
}

void ObserverTest_DoubleSubscriptionSameReference_Callback(int a, int b, AsyncResultHandle result)
private void ObserverTest_DoubleSubscriptionSameReference_Callback(int a, int b, AsyncResultHandle result)
{
callbackCounter++;
this.Logger.LogInformation("Invoking ObserverTest_DoubleSubscriptionSameReference_Callback for {CallbackCounter} time with a={A} and b={B}", this.callbackCounter, a, b);
Expand Down Expand Up @@ -174,7 +174,7 @@ public async Task ObserverTest_SubscribeUnsubscribe()
this.GrainFactory.DeleteObjectReference<ISimpleGrainObserver>(reference);
}

void ObserverTest_SubscribeUnsubscribe_Callback(int a, int b, AsyncResultHandle result)
private void ObserverTest_SubscribeUnsubscribe_Callback(int a, int b, AsyncResultHandle result)
{
callbackCounter++;
this.Logger.LogInformation("Invoking ObserverTest_SubscribeUnsubscribe_Callback for {CallbackCounter} time with a = {A} and b = {B}", this.callbackCounter, a, b);
Expand Down Expand Up @@ -233,7 +233,7 @@ public async Task ObserverTest_DoubleSubscriptionDifferentReferences()
this.GrainFactory.DeleteObjectReference<ISimpleGrainObserver>(reference2);
}

void ObserverTest_DoubleSubscriptionDifferentReferences_Callback(int a, int b, AsyncResultHandle result)
private void ObserverTest_DoubleSubscriptionDifferentReferences_Callback(int a, int b, AsyncResultHandle result)
{
callbackCounter++;
this.Logger.LogInformation("Invoking ObserverTest_DoubleSubscriptionDifferentReferences_Callback for {CallbackCounter} time with a = {A} and b = {B}", this.callbackCounter, a, b);
Expand Down Expand Up @@ -264,7 +264,7 @@ public async Task ObserverTest_DeleteObject()
Assert.False(await result.WaitForFinished(timeout), $"Should timeout waiting {timeout} for SetB");
}

void ObserverTest_DeleteObject_Callback(int a, int b, AsyncResultHandle result)
private void ObserverTest_DeleteObject_Callback(int a, int b, AsyncResultHandle result)
{
callbackCounter++;
this.Logger.LogInformation("Invoking ObserverTest_DeleteObject_Callback for {CallbackCounter} time with a = {A} and b = {B}", this.callbackCounter, a, b);
Expand Down Expand Up @@ -319,8 +319,8 @@ public void StateChanged(int a, int b) { }

internal class SimpleGrainObserver : ISimpleGrainObserver
{
readonly Action<int, int, AsyncResultHandle> action;
readonly AsyncResultHandle result;
private readonly Action<int, int, AsyncResultHandle> action;
private readonly AsyncResultHandle result;

private readonly ILogger logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Tester.RelationalUtilities
{
class PostgreSqlStorageForTesting : RelationalStorageForTesting
internal class PostgreSqlStorageForTesting : RelationalStorageForTesting
{
protected override string ProviderMoniker => "PostgreSQL";

Expand Down
2 changes: 1 addition & 1 deletion test/Grains/TestGrains/AsyncSimpleGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace UnitTests.Grains
/// </summary>
public class AsyncSimpleGrain : SimpleGrain, ISimpleGrainWithAsyncMethods
{
TaskCompletionSource<int> resolver;
private TaskCompletionSource<int> resolver;

public AsyncSimpleGrain(ILoggerFactory loggerFactory) : base(loggerFactory)
{
Expand Down
6 changes: 3 additions & 3 deletions test/Grains/TestGrains/ConcreteGrainsWithGenericInterfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace UnitTests.Grains
{
class ConcreteGrainWithGenericInterfaceOfIntFloat : Grain, IGenericGrain<int, float>
internal class ConcreteGrainWithGenericInterfaceOfIntFloat : Grain, IGenericGrain<int, float>
{
protected int T { get; set; }

Expand All @@ -18,7 +18,7 @@ public Task<float> MapT2U()
}
}

class ConcreteGrainWithGenericInterfaceOfFloatString : Grain, IGenericGrain<float, string>
internal class ConcreteGrainWithGenericInterfaceOfFloatString : Grain, IGenericGrain<float, string>
{
protected float T { get; set; }

Expand All @@ -34,7 +34,7 @@ public Task<string> MapT2U()
}
}

class ConcreteGrainWith2GenericInterfaces : Grain, IGenericGrain<int, string>, ISimpleGenericGrain<int>
internal class ConcreteGrainWith2GenericInterfaces : Grain, IGenericGrain<int, string>, ISimpleGenericGrain<int>
{
// IGenericGrain<int, string> methods:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public ReservationState()
Reservations = new Dictionary<int, SeatReservation>();
}

void Apply(SeatReservation reservation)
private void Apply(SeatReservation reservation)
{
// see if this reservation targets an available seat
// otherwise, treat it as a no-op
Expand Down
2 changes: 1 addition & 1 deletion test/Grains/TestGrains/GeneratedEventReporterGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TestGrains
{
class GeneratedEventReporterGrain : Grain, IGeneratedEventReporterGrain
internal class GeneratedEventReporterGrain : Grain, IGeneratedEventReporterGrain
{
private readonly ILogger logger;

Expand Down
3 changes: 1 addition & 2 deletions test/Grains/TestGrains/GenericGrains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,7 @@ public Task<string[]> ConcreteGenArgTypeNames() {
);
}


Type GetImmediateSubclass(Type subject) {
private Type GetImmediateSubclass(Type subject) {
if(subject.BaseType == typeof(BasicGrain)) {
return subject;
}
Expand Down
2 changes: 1 addition & 1 deletion test/Grains/TestGrains/ProducerEventCountingGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace UnitTests.Grains
{
class ProducerEventCountingGrain : BaseGrain, IProducerEventCountingGrain
internal class ProducerEventCountingGrain : BaseGrain, IProducerEventCountingGrain
{
private IAsyncObserver<int> _producer;
private int _numProducedItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected override Task ProducerOnNextAsync(IAsyncStream<Apple> theProducer)
public class Apple : IFruit
{
[Id(0)]
readonly int number;
private readonly int number;

public Apple(int number)
{
Expand Down
8 changes: 4 additions & 4 deletions test/Grains/TestGrains/ReentrantGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static bool MayInterleave(IInvokable req)
return arg == "reentrant";
}

static object UnwrapImmutable(object item) => item is Immutable<object> ? ((Immutable<object>)item).Value : item;
private static object UnwrapImmutable(object item) => item is Immutable<object> ? ((Immutable<object>)item).Value : item;

private IMayInterleaveStaticPredicateGrain Self { get; set; }

Expand Down Expand Up @@ -145,7 +145,7 @@ public Task PushToStream(string item)
return GetStream().OnNextAsync(item);
}

IAsyncStream<string> GetStream() =>
private IAsyncStream<string> GetStream() =>
this.GetStreamProvider("sms").GetStream<string>("test-stream-interleave", Guid.Empty);

public Task SetSelf(IMayInterleaveStaticPredicateGrain self)
Expand Down Expand Up @@ -187,7 +187,7 @@ public bool MayInterleave(IInvokable req)
return arg == "reentrant";
}

static object UnwrapImmutable(object item) => item is Immutable<object> ? ((Immutable<object>)item).Value : item;
private static object UnwrapImmutable(object item) => item is Immutable<object> ? ((Immutable<object>)item).Value : item;

private IMayInterleaveInstancedPredicateGrain Self { get; set; }

Expand Down Expand Up @@ -229,7 +229,7 @@ public Task PushToStream(string item)
return GetStream().OnNextAsync(item);
}

IAsyncStream<string> GetStream() =>
private IAsyncStream<string> GetStream() =>
this.GetStreamProvider("sms").GetStream<string>("test-stream-interleave", Guid.Empty);

public Task SetSelf(IMayInterleaveInstancedPredicateGrain self)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace UnitTests.GrainInterfaces
{
interface ISerializerPresenceTest : IGrainWithGuidKey
internal interface ISerializerPresenceTest : IGrainWithGuidKey
{
Task<bool> SerializerExistsForType(System.Type param);

Expand Down
Loading

0 comments on commit 163b935

Please sign in to comment.