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

remove redundant private set #6887

Closed
Closed
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
2 changes: 1 addition & 1 deletion src/benchmark/Akka.Benchmarks/Logging/LoggingBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class LoggingBenchmarks
private sealed class BenchmarkLogAdapter : LoggingAdapterBase
{
public int CurrentLogs { get; private set; }
public LogEvent[] AllLogs { get; private set; }
public LogEvent[] AllLogs { get; }

private readonly string _logSource;
private readonly Type _logClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Akka.Cluster.Metrics.Serialization
[InternalApi]
public sealed partial class MetricsGossip
{
public IImmutableSet<NodeMetrics> Nodes { get; private set; } = ImmutableHashSet<NodeMetrics>.Empty;
public IImmutableSet<NodeMetrics> Nodes { get; } = ImmutableHashSet<NodeMetrics>.Empty;

/// <summary>
/// Empty metrics gossip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Akka.Cluster.Metrics.Serialization
/// </summary>
public sealed partial class NodeMetrics
{
public Actor.Address Address { get; private set; }
public Actor.Address Address { get; }

/// <summary>
/// Creates new instance of <see cref="NodeMetrics"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public ActorSys(string name = "ClusterSingletonProxySystem", Address joinTo = nu
$"singletonProxy-{Cluster.SelfAddress.Port ?? 0}");
}

public IActorRef Proxy { get; private set; }
public IActorRef Proxy { get; }

public void TestProxy(string msg)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ public class SnapshotStoreSettings
/// <summary>
/// Schema name, where table corresponding to snapshot store is placed.
/// </summary>
public string SchemaName { get; private set; }
public string SchemaName { get; }

/// <summary>
/// Name of the table corresponding to snapshot store.
/// </summary>
public string TableName { get; private set; }
public string TableName { get; }

/// <summary>
/// Flag determining in in case of snapshot store table missing, they should be automatically initialized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Akka.Tests.Serialization
{
public class ImmutableMessage
{
public string Foo { get; private set; }
public string Bar { get; private set; }
public string Foo { get; }
public string Bar { get; }

public ImmutableMessage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Akka.Tests.Serialization
{
public class ImmutableMessageWithPrivateCtor
{
public string Foo { get; private set; }
public string Bar { get; private set; }
public string Foo { get; }
public string Bar { get; }

protected ImmutableMessageWithPrivateCtor()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ namespace Akka.Cluster.Tests.MultiNode
{
public class ClientDowningNodeThatIsUnreachableMultiNodeConfig : MultiNodeConfig
{
public RoleName First { get; private set; }
public RoleName First { get; }

public RoleName Second { get; private set; }
public RoleName Second { get; }

public RoleName Third { get; private set; }
public RoleName Third { get; }

public RoleName Fourth { get; private set; }
public RoleName Fourth { get; }

public ClientDowningNodeThatIsUnreachableMultiNodeConfig(bool failureDetectorPuppet)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
namespace Akka.Cluster.Tests.MultiNode
{
public class ClusterAccrualFailureDetectorMultiSpec : MultiNodeConfig {
public RoleName First { get; private set; }
public RoleName First { get; }

public RoleName Second { get; private set; }
public RoleName Second { get; }

public RoleName Third { get; private set; }
public RoleName Third { get; }

public ClusterAccrualFailureDetectorMultiSpec()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ namespace Akka.Cluster.Tests.MultiNode
{
public class LeaderDowningNodeThatIsUnreachableConfig : MultiNodeConfig
{
public RoleName First { get; private set; }
public RoleName Second { get; private set; }
public RoleName Third { get; private set; }
public RoleName Fourth { get; private set; }
public RoleName First { get; }
public RoleName Second { get; }
public RoleName Third { get; }
public RoleName Fourth { get; }

public LeaderDowningNodeThatIsUnreachableConfig(bool failureDetectorPuppet)
{
Expand Down
10 changes: 5 additions & 5 deletions src/core/Akka.Cluster.Tests.MultiNode/LeaderElectionSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ namespace Akka.Cluster.Tests.MultiNode
{
public class LeaderElectionSpecConfig : MultiNodeConfig
{
public RoleName Controller { get; private set; }
public RoleName First { get; private set; }
public RoleName Second { get; private set; }
public RoleName Third { get; private set; }
public RoleName Forth { get; private set; }
public RoleName Controller { get; }
public RoleName First { get; }
public RoleName Second { get; }
public RoleName Third { get; }
public RoleName Forth { get; }

public LeaderElectionSpecConfig(bool failureDetectorPuppet)
{
Expand Down
6 changes: 3 additions & 3 deletions src/core/Akka.Cluster.Tests.MultiNode/RestartNode3Spec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ namespace Akka.Cluster.Tests.MultiNode
{
public class RestartNode3SpecConfig : MultiNodeConfig
{
public RoleName First { get; private set; }
public RoleName Second { get; private set; }
public RoleName Third { get; private set; }
public RoleName First { get; }
public RoleName Second { get; }
public RoleName Third { get; }

public RestartNode3SpecConfig()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Collected(HashSet<object> messages)
Messages = messages;
}

public HashSet<object> Messages { get; private set; }
public HashSet<object> Messages { get; }
}

public class Destination : UntypedActor
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster.Tests/SBR/SplitBrainResolverSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ public SetupLeaseMajority(

internal abstract class Setup
{
public IActorRef A { get; private set; }
public IActorRef A { get; }

public Setup(
SplitBrainResolverSpec owner,
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Cluster/Routing/ClusterRoutingConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ public ClusterRouterGroupActor(ClusterRouterGroupSettings settings) : base(setti
/// <summary>
/// TBD
/// </summary>
public new ClusterRouterGroupSettings Settings { get; private set; }
public new ClusterRouterGroupSettings Settings { get; }

/// <summary>
/// TBD
Expand Down Expand Up @@ -870,7 +870,7 @@ protected override SupervisorStrategy SupervisorStrategy()
/// <summary>
/// TBD
/// </summary>
public new ClusterRouterPoolSettings Settings { get; private set; }
public new ClusterRouterPoolSettings Settings { get; }

/// <summary>
/// TBD
Expand Down
20 changes: 10 additions & 10 deletions src/core/Akka.Persistence.Tests/AtLeastOnceDeliveryFailureSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Done(int[] ints)
Ints = ints;
}

public int[] Ints { get; private set; }
public int[] Ints { get; }
}

internal struct Ack
Expand All @@ -65,7 +65,7 @@ public Ack(int i)
I = i;
}

public int I { get; private set; }
public int I { get; }
}

internal struct Msg
Expand All @@ -77,8 +77,8 @@ public Msg(long deliveryId, int i)
DeliveryId = deliveryId;
}

public int I { get; private set; }
public long DeliveryId { get; private set; }
public int I { get; }
public long DeliveryId { get; }
}

internal struct Confirm
Expand All @@ -90,8 +90,8 @@ public Confirm(long deliveryId, int i)
DeliveryId = deliveryId;
}

public int I { get; private set; }
public long DeliveryId { get; private set; }
public int I { get; }
public long DeliveryId { get; }
}

internal interface IEvt { }
Expand All @@ -104,7 +104,7 @@ public MsgSent(int i)
I = i;
}

public int I { get; private set; }
public int I { get; }
}

internal struct MsgConfirmed : IEvt
Expand All @@ -116,7 +116,7 @@ public MsgConfirmed(long deliveryId, int i)
I = i;
}

public long DeliveryId { get; private set; }
public long DeliveryId { get; }
public int I { get; private set; }
}

Expand Down Expand Up @@ -232,7 +232,7 @@ protected override void OnPersistFailure(Exception cause, object @event, long se
// mute logging
}

public IActorRef Probe { get; private set; }
public IActorRef Probe { get; }
public List<int> State { get; set; }
}

Expand Down Expand Up @@ -271,7 +271,7 @@ public ChaosDestination(IActorRef probe)
});
}

public IActorRef Probe { get; private set; }
public IActorRef Probe { get; }
public List<int> State { get; set; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public EventSourcedProducerQueueSpec(ITestOutputHelper output) : base(Config, ou

private static readonly AtomicCounter _pidCounter = new(0);
private string NextPersistenceId() => $"p-{_pidCounter.IncrementAndGet()}";
public TestProbe JournalOperationsProbe { get; private set; }
public TestProbe StateProbe { get; private set; }
public TestProbe JournalOperationsProbe { get; }
public TestProbe StateProbe { get; }

[Fact]
public async Task EventSourcedDurableProducerQueue_must_persist_MessageSent()
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Persistence.Tests/Fsm/PersistentFSMSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ public AddItem(Item item)
Item = item;
}

public Item Item { get; private set; }
public Item Item { get; }
}

internal class Buy
Expand Down Expand Up @@ -907,7 +907,7 @@ public ItemAdded(Item item)
Item = item;
}

public Item Item { get; private set; }
public Item Item { get; }
}

internal class OrderExecuted : IDomainEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class PersistentActorDeleteFailureSpec : PersistenceSpec
{
internal class DeleteTo
{
public long N { get; private set; }
public long N { get; }

public DeleteTo(long n)
{
Expand Down
Loading
Loading