Skip to content

Commit

Permalink
remove redundant string interpolation (#6938)
Browse files Browse the repository at this point in the history
Co-authored-by: Gregorius Soedharmo <arkatufus@yahoo.com>
  • Loading branch information
SimonCropp and Arkatufus authored Oct 11, 2023
1 parent ec2e660 commit f937db3
Show file tree
Hide file tree
Showing 29 changed files with 69 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ public class ClusterMetricsAutostartSpec : AkkaSpec
/// <summary>
/// This is a single node test.
/// </summary>
private static readonly Config Config = ConfigurationFactory.ParseString($@"
akka {{
private static readonly Config Config = ConfigurationFactory.ParseString(@"
akka {
extensions = [""Akka.Cluster.Metrics.ClusterMetricsExtensionProvider, Akka.Cluster.Metrics""]
actor.provider = ""cluster""
cluster.metrics.collector {{
cluster.metrics.collector {
provider = [""Akka.Cluster.Metrics.Collectors.DefaultCollector, Akka.Cluster.Metrics""]
sample-interval = 200ms
gossip-interval = 200ms
}}
}}
}
}
");

public ClusterMetricsAutostartSpec(ITestOutputHelper output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ private void ClusterSharding_must_complete_a_rolling_upgrade()
{
AwaitAssert(() =>
{
shardRegion.Value.Tell(new GiveMeYourHome.Get($"id1"));
shardRegion.Value.Tell(new GiveMeYourHome.Get("id1"));
ExpectMsg<GiveMeYourHome.Home>();
shardRegion.Value.Tell(new GiveMeYourHome.Get($"id2"));
shardRegion.Value.Tell(new GiveMeYourHome.Get("id2"));
ExpectMsg<GiveMeYourHome.Home>();
});
}, config.Second, config.Third, config.Fourth);
Expand All @@ -282,11 +282,11 @@ private void ClusterSharding_must_complete_a_rolling_upgrade()
{
AwaitAssert(() =>
{
shardRegion.Value.Tell(new GiveMeYourHome.Get($"id1"));
shardRegion.Value.Tell(new GiveMeYourHome.Get("id1"));
var address1 = ExpectMsg<GiveMeYourHome.Home>().Address;
UpMembers.Select(i => i.Address).Should().Contain(address1);
shardRegion.Value.Tell(new GiveMeYourHome.Get($"id2"));
shardRegion.Value.Tell(new GiveMeYourHome.Get("id2"));
var address2 = ExpectMsg<GiveMeYourHome.Home>().Address;
UpMembers.Select(i => i.Address).Should().Contain(address2);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private GetShardLocations()
{
}

public override string ToString() => $"GetShardLocations";
public override string ToString() => "GetShardLocations";
}

public sealed class GetShardLocationsResponse : INoSerializationVerificationNeeded, IEquatable<GetShardLocationsResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private MigrationMarker()
}

/// <inheritdoc/>
public override string ToString() => $"MigrationMarker";
public override string ToString() => "MigrationMarker";
}

public EventSourcedRememberEntitiesCoordinatorStore(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private GetEntities()
}

/// <inheritdoc/>
public override string ToString() => $"GetEntities";
public override string ToString() => "GetEntities";
}

public sealed class RememberedEntities : ICommand, IEquatable<RememberedEntities>
Expand Down Expand Up @@ -349,7 +349,7 @@ private GetShards()
}

/// <inheritdoc/>
public override string ToString() => $"GetShards";
public override string ToString() => "GetShards";
}

public sealed class RememberedShards : ICommand, IEquatable<RememberedShards>
Expand Down
10 changes: 5 additions & 5 deletions src/contrib/cluster/Akka.Cluster.Sharding/Shard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private GetShardStats()
}

/// <inheritdoc/>
public override string ToString() => $"GetShardStats";
public override string ToString() => "GetShardStats";
}

/// <summary>
Expand Down Expand Up @@ -486,7 +486,7 @@ public override EntityState Transition(EntityState newState, Entities entities)
}

/// <inheritdoc/>
public override string ToString() => $"NoState";
public override string ToString() => "NoState";
}

/// <summary>
Expand Down Expand Up @@ -516,7 +516,7 @@ public override EntityState Transition(EntityState newState, Entities entities)
}

/// <inheritdoc/>
public override string ToString() => $"RememberedButNotCreated";
public override string ToString() => "RememberedButNotCreated";
}

/// <summary>
Expand Down Expand Up @@ -627,7 +627,7 @@ public override EntityState Transition(EntityState newState, Entities entities)
}

/// <inheritdoc/>
public override string ToString() => $"RememberingStop";
public override string ToString() => "RememberingStop";
}

internal abstract class WithRef : EntityState, IEquatable<WithRef>
Expand Down Expand Up @@ -733,7 +733,7 @@ public override EntityState Transition(EntityState newState, Entities entities)
}

/// <inheritdoc/>
public override string ToString() => $"WaitingForRestart";
public override string ToString() => "WaitingForRestart";
}

internal sealed class Entities
Expand Down
6 changes: 3 additions & 3 deletions src/contrib/cluster/Akka.Cluster.Sharding/ShardingMessages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private GetCurrentRegions()
{
}

public override string ToString() => $"GetCurrentRegions";
public override string ToString() => "GetCurrentRegions";
}

/// <summary>
Expand Down Expand Up @@ -405,7 +405,7 @@ private GetShardRegionStats()
{
}

public override string ToString() => $"GetShardRegionStats";
public override string ToString() => "GetShardRegionStats";
}

/// <summary>
Expand Down Expand Up @@ -499,7 +499,7 @@ private GetShardRegionState()
{
}

public override string ToString() => $"GetShardRegionState";
public override string ToString() => "GetShardRegionState";
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ public DurableDataPocoSpecConfig(bool writeBehind)
akka.test.single-expect-default = 15s")
.WithFallback(DistributedData.DefaultConfig());

NodeConfig(new[] { First }, new[] { ConfigurationFactory.ParseString($@"
akka.cluster.distributed-data.durable.lmdb {{
NodeConfig(new[] { First }, new[] { ConfigurationFactory.ParseString(@"
akka.cluster.distributed-data.durable.lmdb {
dir = ""target/DurableDataPocoSpec/first-ddata""
}}
}
") });

NodeConfig(new[] { Second }, new[] { ConfigurationFactory.ParseString($@"
akka.cluster.distributed-data.durable.lmdb {{
NodeConfig(new[] { Second }, new[] { ConfigurationFactory.ParseString(@"
akka.cluster.distributed-data.durable.lmdb {
dir = ""target/DurableDataPocoSpec/second-ddata""
}}
}
") });

NodeConfig(new[] { Third }, new[] { ConfigurationFactory.ParseString($@"
akka.cluster.distributed-data.durable.lmdb {{
NodeConfig(new[] { Third }, new[] { ConfigurationFactory.ParseString(@"
akka.cluster.distributed-data.durable.lmdb {
dir = ""target/DurableDataPocoSpec/third-ddata""
}}
}
") });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ internal sealed class ReadRepairAck
private ReadRepairAck() { }

/// <inheritdoc/>
public override string ToString() => $"ReadRepairAck";
public override string ToString() => "ReadRepairAck";
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public ORMultiValueDictionary<TKey, TValue> Merge(ORMultiValueDictionary<TKey, T
: new ORMultiValueDictionary<TKey, TValue>(Underlying.Merge(other.Underlying), _withValueDeltas);
}

throw new ArgumentException($"Trying to merge two ORMultiValueDictionaries of different map sub-types");
throw new ArgumentException("Trying to merge two ORMultiValueDictionaries of different map sub-types");
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/contrib/cluster/Akka.DistributedData/ORSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ public ORSet<T> MergeDelta(IDeltaOperation delta)
case AddDeltaOperation op: acc = acc.DryMerge(op.Underlying, addDeltaOp: true); break;
case RemoveDeltaOperation op: acc = acc.MergeRemoveDelta(op); break;
case FullStateDeltaOperation op: acc = acc.DryMerge(op.Underlying, addDeltaOp: false); break;
default: throw new ArgumentException($"GroupDelta should not be nested");
default: throw new ArgumentException("GroupDelta should not be nested");
}
}
return acc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static ReplicatorSettings Create(Config config)
{
if (string.IsNullOrEmpty(durableStoreTypeName))
{
throw new ArgumentException($"`akka.cluster.distributed-data.durable.store-actor-class` must be set when `akka.cluster.distributed-data.durable.keys` have been configured.");
throw new ArgumentException("`akka.cluster.distributed-data.durable.store-actor-class` must be set when `akka.cluster.distributed-data.durable.keys` have been configured.");
}

var durableStoreType = Type.GetType(durableStoreTypeName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ private ORDictionary.IDeltaGroupOp GenericORDictionaryDeltaGroupFromProto<TKey,
{
if (entry.EntryData.Count > 1)
throw new ArgumentOutOfRangeException(
$"Can't deserialize key/value pair in ORDictionary delta - too many pairs on the wire");
"Can't deserialize key/value pair in ORDictionary delta - too many pairs on the wire");
var (key, value) = MapEntryFromProto(entry.EntryData[0]);

deltaOps.Add(new ORDictionary<TKey, TValue>.PutDeltaOperation(new ORSet<TKey>.AddDeltaOperation((ORSet<TKey>)underlying), (TKey)key, (TValue)value));
Expand All @@ -1090,7 +1090,7 @@ private ORDictionary.IDeltaGroupOp GenericORDictionaryDeltaGroupFromProto<TKey,
{
if (entry.EntryData.Count > 1)
throw new ArgumentOutOfRangeException(
$"Can't deserialize key/value pair in ORDictionary delta - too many pairs on the wire");
"Can't deserialize key/value pair in ORDictionary delta - too many pairs on the wire");
var (key, value) = MapEntryFromProto(entry.EntryData[0]);
deltaOps.Add(new ORDictionary<TKey, TValue>.RemoveKeyDeltaOperation(new ORSet<TKey>.RemoveDeltaOperation((ORSet<TKey>)underlying), (TKey)key));
}
Expand Down Expand Up @@ -1122,7 +1122,7 @@ private ORDictionary.IPutDeltaOp ORDictionaryPutFromBinary(byte[] bytes)
if (groupOp.OperationsSerialization.Count == 1 &&
groupOp.OperationsSerialization.First() is ORDictionary.IPutDeltaOp put)
return put;
throw new SerializationException($"Improper ORDictionary delta put operation size or kind");
throw new SerializationException("Improper ORDictionary delta put operation size or kind");
}

private ORDictionary.IRemoveDeltaOp ORDictionaryRemoveFromBinary(byte[] bytes)
Expand All @@ -1131,7 +1131,7 @@ private ORDictionary.IRemoveDeltaOp ORDictionaryRemoveFromBinary(byte[] bytes)
if (groupOp.OperationsSerialization.Count == 1 &&
groupOp.OperationsSerialization.First() is ORDictionary.IRemoveDeltaOp remove)
return remove;
throw new SerializationException($"Improper ORDictionary delta remove operation size or kind");
throw new SerializationException("Improper ORDictionary delta remove operation size or kind");
}

private ORDictionary.IRemoveKeyDeltaOp ORDictionaryRemoveKeyFromBinary(byte[] bytes)
Expand All @@ -1140,7 +1140,7 @@ private ORDictionary.IRemoveKeyDeltaOp ORDictionaryRemoveKeyFromBinary(byte[] by
if (groupOp.OperationsSerialization.Count == 1 &&
groupOp.OperationsSerialization.First() is ORDictionary.IRemoveKeyDeltaOp removeKey)
return removeKey;
throw new SerializationException($"Improper ORDictionary delta remove key operation size or kind");
throw new SerializationException("Improper ORDictionary delta remove key operation size or kind");
}

private ORDictionary.IUpdateDeltaOp ORDictionaryUpdateFromBinary(byte[] bytes)
Expand All @@ -1149,7 +1149,7 @@ private ORDictionary.IUpdateDeltaOp ORDictionaryUpdateFromBinary(byte[] bytes)
if (groupOp.OperationsSerialization.Count == 1 &&
groupOp.OperationsSerialization.First() is ORDictionary.IUpdateDeltaOp update)
return update;
throw new SerializationException($"Improper ORDictionary delta update operation size or kind");
throw new SerializationException("Improper ORDictionary delta update operation size or kind");
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Akka.Persistence.Query.InMemory.Tests
{
public class InMemoryAllEventsSpec : AllEventsSpec
{
private static Config Config() => ConfigurationFactory.ParseString($@"
private static Config Config() => ConfigurationFactory.ParseString(@"
akka.loglevel = INFO
akka.persistence.query.journal.inmem.refresh-interval = 1s
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Akka.Persistence.Query.InMemory.Tests
{
public class InMemoryCurrentAllEventsSpec : CurrentAllEventsSpec
{
private static Config Config() => ConfigurationFactory.ParseString($@"
private static Config Config() => ConfigurationFactory.ParseString(@"
akka.loglevel = INFO
akka.persistence.query.journal.inmem.refresh-interval = 1s
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Akka.Persistence.Query.InMemory.Tests
{
public class InMemoryCurrentEventsByPersistenceIdSpec : CurrentEventsByPersistenceIdSpec
{
private static Config Config() => ConfigurationFactory.ParseString($@"
private static Config Config() => ConfigurationFactory.ParseString(@"
akka.loglevel = INFO
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem""
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ namespace Akka.Persistence.Query.InMemory.Tests
{
public class InMemoryCurrentEventsByTagSpec : CurrentEventsByTagSpec
{
private static Config Config() => ConfigurationFactory.ParseString($@"
private static Config Config() => ConfigurationFactory.ParseString(@"
akka.loglevel = INFO
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem""
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""
akka.persistence.journal.inmem {{
event-adapters {{
akka.persistence.journal.inmem {
event-adapters {
color-tagger = ""Akka.Persistence.TCK.Query.ColorFruitTagger, Akka.Persistence.TCK""
}}
event-adapter-bindings = {{
}
event-adapter-bindings = {
""System.String"" = color-tagger
}}
}}")
}
}")
.WithFallback(InMemoryReadJournal.DefaultConfiguration());

public InMemoryCurrentEventsByTagSpec(ITestOutputHelper output) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Akka.Persistence.Query.InMemory.Tests
{
public class InMemoryCurrentPersistenceIdsSpec : CurrentPersistenceIdsSpec
{
private static Config Config() => ConfigurationFactory.ParseString($@"
private static Config Config() => ConfigurationFactory.ParseString(@"
akka.loglevel = INFO
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem""
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Akka.Persistence.Query.InMemory.Tests
{
public class InMemoryEventsByPersistenceIdSpec : EventsByPersistenceIdSpec
{
private static Config Config() => ConfigurationFactory.ParseString($@"
private static Config Config() => ConfigurationFactory.ParseString(@"
akka.loglevel = INFO
akka.persistence.query.journal.inmem.refresh-interval = 1s
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ namespace Akka.Persistence.Query.InMemory.Tests
{
public class InMemoryEventsByTagSpec : EventsByTagSpec
{
private static Config Config() => ConfigurationFactory.ParseString($@"
private static Config Config() => ConfigurationFactory.ParseString(@"
akka.loglevel = INFO
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem""
akka.persistence.snapshot-store.plugin = ""akka.persistence.snapshot-store.inmem""
akka.persistence.journal.inmem {{
event-adapters {{
akka.persistence.journal.inmem {
event-adapters {
color-tagger = ""Akka.Persistence.TCK.Query.ColorFruitTagger, Akka.Persistence.TCK""
}}
event-adapter-bindings = {{
}
event-adapter-bindings = {
""System.String"" = color-tagger
}}
}}")
}
}")
.WithFallback(InMemoryReadJournal.DefaultConfiguration());

public InMemoryEventsByTagSpec(ITestOutputHelper output) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Akka.Persistence.Query.InMemory.Tests
{
public class InMemoryPersistenceIdsSpec : PersistenceIdsSpec
{
private static Config Config() => ConfigurationFactory.ParseString($@"
private static Config Config() => ConfigurationFactory.ParseString(@"
akka.loglevel = INFO
akka.persistence.query.journal.inmem.refresh-interval = 1s
akka.persistence.journal.plugin = ""akka.persistence.journal.inmem""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void Run(BenchmarkContext context)
context.Trace.Info($"Started ActorSystem1 on {Cluster.Get(OtherSys).SelfAddress}");
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
_clusterMemberUp.Task.Wait(cts.Token);
context.Trace.Info($"Successfully joined cluster.");
context.Trace.Info("Successfully joined cluster.");
}

[PerfCleanup]
Expand Down
Loading

0 comments on commit f937db3

Please sign in to comment.