From f937db3ce43f9387f439f75fe4ebdc8fad162d0d Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 12 Oct 2023 00:17:48 +1100 Subject: [PATCH] remove redundant string interpolation (#6938) Co-authored-by: Gregorius Soedharmo --- .../ClusterMetricsAutostartSpec.cs | 10 +++++----- .../RollingUpdateShardAllocationSpec.cs | 8 ++++---- .../ExternalShardAllocationStrategy.cs | 2 +- ...tSourcedRememberEntitiesCoordinatorStore.cs | 2 +- .../Internal/RememberEntitiesStore.cs | 4 ++-- .../cluster/Akka.Cluster.Sharding/Shard.cs | 10 +++++----- .../Akka.Cluster.Sharding/ShardingMessages.cs | 6 +++--- .../DurableDataPocoSpec.cs | 18 +++++++++--------- .../Akka.DistributedData/Internal/Internal.cs | 2 +- .../ORMultiValueDictionary.cs | 2 +- .../cluster/Akka.DistributedData/ORSet.cs | 2 +- .../Akka.DistributedData/ReplicatorSettings.cs | 2 +- .../Serialization/ReplicatedDataSerializer.cs | 12 ++++++------ .../InMemoryAllEventsSpec.cs | 2 +- .../InMemoryCurrentAllEventsSpec.cs | 2 +- ...InMemoryCurrentEventsByPersistenceIdSpec.cs | 2 +- .../InMemoryCurrentEventsByTagSpec.cs | 14 +++++++------- .../InMemoryCurrentPersistenceIdsSpec.cs | 2 +- .../InMemoryEventsByPersistenceIdSpec.cs | 2 +- .../InMemoryEventsByTagSpec.cs | 14 +++++++------- .../InMemoryPersistenceIdsSpec.cs | 2 +- .../Startup/ClusterStartupSpec.cs | 2 +- .../OptimizedRecoverySpec.cs | 2 +- src/core/Akka.Streams.Tests/Dsl/RestartSpec.cs | 2 +- src/core/Akka.Streams/Dsl/Sample.cs | 2 +- src/core/Akka.Streams/KillSwitch.cs | 2 +- .../Actor/Scheduler/SchedulerShutdownSpec.cs | 2 +- src/core/Akka.Tests/IO/TcpIntegrationSpec.cs | 2 +- src/core/Akka/IO/TcpConnection.cs | 4 ++-- 29 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/contrib/cluster/Akka.Cluster.Metrics.Tests/ClusterMetricsAutostartSpec.cs b/src/contrib/cluster/Akka.Cluster.Metrics.Tests/ClusterMetricsAutostartSpec.cs index 9077561a59b..e7e5e83d27f 100644 --- a/src/contrib/cluster/Akka.Cluster.Metrics.Tests/ClusterMetricsAutostartSpec.cs +++ b/src/contrib/cluster/Akka.Cluster.Metrics.Tests/ClusterMetricsAutostartSpec.cs @@ -24,16 +24,16 @@ public class ClusterMetricsAutostartSpec : AkkaSpec /// /// This is a single node test. /// - 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) diff --git a/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/RollingUpdateShardAllocationSpec.cs b/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/RollingUpdateShardAllocationSpec.cs index e7b57c227d7..5eb00c3b58a 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/RollingUpdateShardAllocationSpec.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/RollingUpdateShardAllocationSpec.cs @@ -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(); - shardRegion.Value.Tell(new GiveMeYourHome.Get($"id2")); + shardRegion.Value.Tell(new GiveMeYourHome.Get("id2")); ExpectMsg(); }); }, config.Second, config.Third, config.Fourth); @@ -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().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().Address; UpMembers.Select(i => i.Address).Should().Contain(address2); }); diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/External/ExternalShardAllocationStrategy.cs b/src/contrib/cluster/Akka.Cluster.Sharding/External/ExternalShardAllocationStrategy.cs index ccd85e1b10a..245686cb55c 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/External/ExternalShardAllocationStrategy.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/External/ExternalShardAllocationStrategy.cs @@ -64,7 +64,7 @@ private GetShardLocations() { } - public override string ToString() => $"GetShardLocations"; + public override string ToString() => "GetShardLocations"; } public sealed class GetShardLocationsResponse : INoSerializationVerificationNeeded, IEquatable diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/Internal/EventSourcedRememberEntitiesCoordinatorStore.cs b/src/contrib/cluster/Akka.Cluster.Sharding/Internal/EventSourcedRememberEntitiesCoordinatorStore.cs index b8edd25380c..f224e3b3e95 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/Internal/EventSourcedRememberEntitiesCoordinatorStore.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/Internal/EventSourcedRememberEntitiesCoordinatorStore.cs @@ -81,7 +81,7 @@ private MigrationMarker() } /// - public override string ToString() => $"MigrationMarker"; + public override string ToString() => "MigrationMarker"; } public EventSourcedRememberEntitiesCoordinatorStore( diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/Internal/RememberEntitiesStore.cs b/src/contrib/cluster/Akka.Cluster.Sharding/Internal/RememberEntitiesStore.cs index 3d4861c7d30..50df0bf062c 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/Internal/RememberEntitiesStore.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/Internal/RememberEntitiesStore.cs @@ -162,7 +162,7 @@ private GetEntities() } /// - public override string ToString() => $"GetEntities"; + public override string ToString() => "GetEntities"; } public sealed class RememberedEntities : ICommand, IEquatable @@ -349,7 +349,7 @@ private GetShards() } /// - public override string ToString() => $"GetShards"; + public override string ToString() => "GetShards"; } public sealed class RememberedShards : ICommand, IEquatable diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/Shard.cs b/src/contrib/cluster/Akka.Cluster.Sharding/Shard.cs index 352866a505d..1ed5b982b37 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/Shard.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/Shard.cs @@ -226,7 +226,7 @@ private GetShardStats() } /// - public override string ToString() => $"GetShardStats"; + public override string ToString() => "GetShardStats"; } /// @@ -486,7 +486,7 @@ public override EntityState Transition(EntityState newState, Entities entities) } /// - public override string ToString() => $"NoState"; + public override string ToString() => "NoState"; } /// @@ -516,7 +516,7 @@ public override EntityState Transition(EntityState newState, Entities entities) } /// - public override string ToString() => $"RememberedButNotCreated"; + public override string ToString() => "RememberedButNotCreated"; } /// @@ -627,7 +627,7 @@ public override EntityState Transition(EntityState newState, Entities entities) } /// - public override string ToString() => $"RememberingStop"; + public override string ToString() => "RememberingStop"; } internal abstract class WithRef : EntityState, IEquatable @@ -733,7 +733,7 @@ public override EntityState Transition(EntityState newState, Entities entities) } /// - public override string ToString() => $"WaitingForRestart"; + public override string ToString() => "WaitingForRestart"; } internal sealed class Entities diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/ShardingMessages.cs b/src/contrib/cluster/Akka.Cluster.Sharding/ShardingMessages.cs index a95d8094758..5ec8c2cc5c9 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/ShardingMessages.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/ShardingMessages.cs @@ -157,7 +157,7 @@ private GetCurrentRegions() { } - public override string ToString() => $"GetCurrentRegions"; + public override string ToString() => "GetCurrentRegions"; } /// @@ -405,7 +405,7 @@ private GetShardRegionStats() { } - public override string ToString() => $"GetShardRegionStats"; + public override string ToString() => "GetShardRegionStats"; } /// @@ -499,7 +499,7 @@ private GetShardRegionState() { } - public override string ToString() => $"GetShardRegionState"; + public override string ToString() => "GetShardRegionState"; } /// diff --git a/src/contrib/cluster/Akka.DistributedData.Tests.MultiNode/DurableDataPocoSpec.cs b/src/contrib/cluster/Akka.DistributedData.Tests.MultiNode/DurableDataPocoSpec.cs index be9ff4d20b1..91e488070ad 100644 --- a/src/contrib/cluster/Akka.DistributedData.Tests.MultiNode/DurableDataPocoSpec.cs +++ b/src/contrib/cluster/Akka.DistributedData.Tests.MultiNode/DurableDataPocoSpec.cs @@ -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"" - }} + } ") }); } } diff --git a/src/contrib/cluster/Akka.DistributedData/Internal/Internal.cs b/src/contrib/cluster/Akka.DistributedData/Internal/Internal.cs index 6fb358dc21a..a531536aabe 100644 --- a/src/contrib/cluster/Akka.DistributedData/Internal/Internal.cs +++ b/src/contrib/cluster/Akka.DistributedData/Internal/Internal.cs @@ -358,7 +358,7 @@ internal sealed class ReadRepairAck private ReadRepairAck() { } /// - public override string ToString() => $"ReadRepairAck"; + public override string ToString() => "ReadRepairAck"; } /// diff --git a/src/contrib/cluster/Akka.DistributedData/ORMultiValueDictionary.cs b/src/contrib/cluster/Akka.DistributedData/ORMultiValueDictionary.cs index e358e4ff0e2..f09ea8b577f 100644 --- a/src/contrib/cluster/Akka.DistributedData/ORMultiValueDictionary.cs +++ b/src/contrib/cluster/Akka.DistributedData/ORMultiValueDictionary.cs @@ -191,7 +191,7 @@ public ORMultiValueDictionary Merge(ORMultiValueDictionary(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"); } /// diff --git a/src/contrib/cluster/Akka.DistributedData/ORSet.cs b/src/contrib/cluster/Akka.DistributedData/ORSet.cs index 2956a83f3f0..fdc595146c8 100644 --- a/src/contrib/cluster/Akka.DistributedData/ORSet.cs +++ b/src/contrib/cluster/Akka.DistributedData/ORSet.cs @@ -690,7 +690,7 @@ public ORSet 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; diff --git a/src/contrib/cluster/Akka.DistributedData/ReplicatorSettings.cs b/src/contrib/cluster/Akka.DistributedData/ReplicatorSettings.cs index 9da01886639..78694084afc 100644 --- a/src/contrib/cluster/Akka.DistributedData/ReplicatorSettings.cs +++ b/src/contrib/cluster/Akka.DistributedData/ReplicatorSettings.cs @@ -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); diff --git a/src/contrib/cluster/Akka.DistributedData/Serialization/ReplicatedDataSerializer.cs b/src/contrib/cluster/Akka.DistributedData/Serialization/ReplicatedDataSerializer.cs index 49967b48b8b..7fcb32f8ff5 100644 --- a/src/contrib/cluster/Akka.DistributedData/Serialization/ReplicatedDataSerializer.cs +++ b/src/contrib/cluster/Akka.DistributedData/Serialization/ReplicatedDataSerializer.cs @@ -1075,7 +1075,7 @@ private ORDictionary.IDeltaGroupOp GenericORDictionaryDeltaGroupFromProto 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.PutDeltaOperation(new ORSet.AddDeltaOperation((ORSet)underlying), (TKey)key, (TValue)value)); @@ -1090,7 +1090,7 @@ private ORDictionary.IDeltaGroupOp GenericORDictionaryDeltaGroupFromProto 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.RemoveKeyDeltaOperation(new ORSet.RemoveDeltaOperation((ORSet)underlying), (TKey)key)); } @@ -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) @@ -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) @@ -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) @@ -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 diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.cs index 2912b3b044b..6e9a7ea611a 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.cs @@ -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"" diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentAllEventsSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentAllEventsSpec.cs index 7aa021f7c62..72e37d842a5 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentAllEventsSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentAllEventsSpec.cs @@ -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"" diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByPersistenceIdSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByPersistenceIdSpec.cs index c186dc79371..5ea00a36c23 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByPersistenceIdSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByPersistenceIdSpec.cs @@ -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""") diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByTagSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByTagSpec.cs index 1c9762551e5..b612a7c5d59 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByTagSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentEventsByTagSpec.cs @@ -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) : diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentPersistenceIdsSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentPersistenceIdsSpec.cs index b14c4d56d8f..1c92cc6926b 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentPersistenceIdsSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryCurrentPersistenceIdsSpec.cs @@ -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""") diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.cs index 095f9b18530..8ab5b8e870a 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.cs @@ -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"" diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.cs index e47176db490..f72bae3a14e 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.cs @@ -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) : diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryPersistenceIdsSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryPersistenceIdsSpec.cs index be28a3edea9..8261372e259 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryPersistenceIdsSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryPersistenceIdsSpec.cs @@ -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"" diff --git a/src/core/Akka.Cluster.Tests.Performance/Startup/ClusterStartupSpec.cs b/src/core/Akka.Cluster.Tests.Performance/Startup/ClusterStartupSpec.cs index a875e8a508f..11b16f43aac 100644 --- a/src/core/Akka.Cluster.Tests.Performance/Startup/ClusterStartupSpec.cs +++ b/src/core/Akka.Cluster.Tests.Performance/Startup/ClusterStartupSpec.cs @@ -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] diff --git a/src/core/Akka.Persistence.Tests/OptimizedRecoverySpec.cs b/src/core/Akka.Persistence.Tests/OptimizedRecoverySpec.cs index 0cff6093a38..aaa140cb4a5 100644 --- a/src/core/Akka.Persistence.Tests/OptimizedRecoverySpec.cs +++ b/src/core/Akka.Persistence.Tests/OptimizedRecoverySpec.cs @@ -104,7 +104,7 @@ protected override bool ReceiveRecover(object message) _probe.Tell(evt); return true; case RecoveryCompleted _: - if (IsRecovering) throw new InvalidOperationException($"Expected !IsRecovering in RecoveryCompleted"); + if (IsRecovering) throw new InvalidOperationException("Expected !IsRecovering in RecoveryCompleted"); _probe.Tell(RecoveryCompleted.Instance); // Verify that persist can be used here Persist(PersistFromRecoveryCompleted.Instance, _ => _probe.Tell(PersistFromRecoveryCompleted.Instance)); diff --git a/src/core/Akka.Streams.Tests/Dsl/RestartSpec.cs b/src/core/Akka.Streams.Tests/Dsl/RestartSpec.cs index 38067063974..8cdb1306b05 100644 --- a/src/core/Akka.Streams.Tests/Dsl/RestartSpec.cs +++ b/src/core/Akka.Streams.Tests/Dsl/RestartSpec.cs @@ -800,7 +800,7 @@ await this.AssertAllStagesStoppedAsync(async () => { if (i == 6) { - throw new ArgumentException($"BOOM"); + throw new ArgumentException("BOOM"); } return i; diff --git a/src/core/Akka.Streams/Dsl/Sample.cs b/src/core/Akka.Streams/Dsl/Sample.cs index bf7db347108..b3e333a1d9d 100644 --- a/src/core/Akka.Streams/Dsl/Sample.cs +++ b/src/core/Akka.Streams/Dsl/Sample.cs @@ -69,7 +69,7 @@ private int GetNextStep() public static Sample Random(int maxStep = 1000) { if (maxStep <= 0) - throw new ArgumentException($"Max step for a random sampling must > 0", nameof(maxStep)); + throw new ArgumentException("Max step for a random sampling must > 0", nameof(maxStep)); return new Sample(() => ThreadLocalRandom.Current.Next(maxStep) + 1); } diff --git a/src/core/Akka.Streams/KillSwitch.cs b/src/core/Akka.Streams/KillSwitch.cs index 6433b438310..1496e7b8bba 100644 --- a/src/core/Akka.Streams/KillSwitch.cs +++ b/src/core/Akka.Streams/KillSwitch.cs @@ -124,7 +124,7 @@ public override void PostStop() private void OnCancelComplete() => CompleteStage(); [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void OnCancelFail() => FailStage(new OperationCanceledException($"Stage cancelled due to cancellation token request.", _stage._cancellationToken)); + private void OnCancelFail() => FailStage(new OperationCanceledException("Stage cancelled due to cancellation token request.", _stage._cancellationToken)); } #endregion diff --git a/src/core/Akka.Tests/Actor/Scheduler/SchedulerShutdownSpec.cs b/src/core/Akka.Tests/Actor/Scheduler/SchedulerShutdownSpec.cs index 6b2f113138b..4bb7806b652 100644 --- a/src/core/Akka.Tests/Actor/Scheduler/SchedulerShutdownSpec.cs +++ b/src/core/Akka.Tests/Actor/Scheduler/SchedulerShutdownSpec.cs @@ -165,7 +165,7 @@ public async Task ActorSystem_default_scheduler_must_never_accept_more_work_afte var terminated = await sys.Terminate().AwaitWithTimeout(TimeSpan.FromSeconds(5)); if (!terminated) - Assert.True(false, $"Expected ActorSystem to terminate within 5s. Took longer."); + Assert.True(false, "Expected ActorSystem to terminate within 5s. Took longer."); Assert.Throws(() => { diff --git a/src/core/Akka.Tests/IO/TcpIntegrationSpec.cs b/src/core/Akka.Tests/IO/TcpIntegrationSpec.cs index 5d285a54f1a..1c952918523 100644 --- a/src/core/Akka.Tests/IO/TcpIntegrationSpec.cs +++ b/src/core/Akka.Tests/IO/TcpIntegrationSpec.cs @@ -558,7 +558,7 @@ public async Task EstablishNewClientConnectionAsync(bool regis connectCommander.Send(_spec.Sys.Tcp(), new Tcp.Connect(_endpoint, options: ConnectOptions)); await connectCommander.ExpectMsgAsync(); - var clientHandler = _spec.CreateTestProbe($"client-handler-probe"); + var clientHandler = _spec.CreateTestProbe("client-handler-probe"); if (registerClientHandler) connectCommander.Sender.Tell(new Tcp.Register(clientHandler.Ref)); diff --git a/src/core/Akka/IO/TcpConnection.cs b/src/core/Akka/IO/TcpConnection.cs index 17298473d35..7e12a58b8b4 100644 --- a/src/core/Akka/IO/TcpConnection.cs +++ b/src/core/Akka/IO/TcpConnection.cs @@ -620,8 +620,8 @@ private bool SafeShutdownOutput() protected void AcquireSocketAsyncEventArgs() { - if (ReceiveArgs != null) throw new InvalidOperationException($"Cannot acquire receive SocketAsyncEventArgs. It's already has been initialized"); - if (SendArgs != null) throw new InvalidOperationException($"Cannot acquire send SocketAsyncEventArgs. It's already has been initialized"); + if (ReceiveArgs != null) throw new InvalidOperationException("Cannot acquire receive SocketAsyncEventArgs. It's already has been initialized"); + if (SendArgs != null) throw new InvalidOperationException("Cannot acquire send SocketAsyncEventArgs. It's already has been initialized"); ReceiveArgs = CreateSocketEventArgs(Self); var buffer = Tcp.BufferPool.Rent();