From 5fdaf6c187692c97877e05d92d84f4f5a55b773b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Fri, 8 Mar 2024 00:32:15 +0100 Subject: [PATCH] Prepare rtm (#382) * Cleanup * Prepare for RTM * Set serializer * Tweaks * Explicit ref * Tweaks * Add license notice --------- Co-authored-by: Brandon Ording --- .github/workflows/ci.yml | 1 - .github/workflows/release.yml | 1 - THIRD-PARTY-NOTICES.txt | 53 +++++++++++++++++++ .../AcceptanceTestLoggerFactory.cs | 1 + .../AcceptanceTesting.csproj | 3 +- src/AcceptanceTesting/BridgeComponent.cs | 15 ++++-- .../AcceptanceTests.ASB.csproj | 4 +- .../AcceptanceTests.ASQ.csproj | 4 +- .../AcceptanceTests.Learning.csproj | 5 -- .../AcceptanceTests.Msmq.csproj | 9 ++-- .../AcceptanceTests.RabbitMQ.csproj | 4 +- .../ConnectionHelper.cs | 1 - .../AcceptanceTests.SQS.csproj | 4 +- .../AcceptanceTests.SqlServer.csproj | 4 +- src/AcceptanceTests/.editorconfig | 1 + src/AcceptanceTests/AcceptanceTests.csproj | 5 -- .../Shared/Support/BridgeAcceptanceTest.cs | 1 - .../Shared/Support/DefaultServer.cs | 1 + .../Shared/Support/DefaultTestServer.cs | 1 + .../NServiceBus.MessagingBridge.Msmq.csproj | 10 ++-- .../HostApplicationBuilderExtensions.cs | 8 ++- .../Configuration/HostBuilderExtensions.cs | 11 ++-- .../CustomChecksBackgroundService.cs | 10 ++-- .../EndpointRegistry.cs | 1 - .../Fastenshtein/LICENSE.md | 26 --------- .../Fastenshtein/Levenshtein.cs | 4 +- .../NServiceBus.MessagingBridge.csproj | 2 +- .../RawEndpoints/ExceptionHeaderHelper.cs | 3 -- src/UnitTests/ExceptionHeaderHelperFixture.cs | 1 - src/UnitTests/UnitTests.csproj | 10 ++-- 30 files changed, 104 insertions(+), 100 deletions(-) create mode 100644 THIRD-PARTY-NOTICES.txt delete mode 100644 src/NServiceBus.MessagingBridge/Fastenshtein/LICENSE.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e54bf272..351104d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,6 @@ jobs: uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.0.x - dotnet-quality: 'preview' - name: Build run: dotnet build src --configuration Release - name: Upload packages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c3e8cd4..b9369ddc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,6 @@ jobs: uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.0.x - dotnet-quality: 'preview' - name: Build run: dotnet build src --configuration Release - name: Sign NuGet packages diff --git a/THIRD-PARTY-NOTICES.txt b/THIRD-PARTY-NOTICES.txt new file mode 100644 index 00000000..85094a33 --- /dev/null +++ b/THIRD-PARTY-NOTICES.txt @@ -0,0 +1,53 @@ +License notice for .NET Reference Source +---------------------------------------- + +https://github.com/microsoft/referencesource/blob/master/LICENSE.txt + +The MIT License (MIT) + +Copyright (c) Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +License notice for Fastenshtein +---------------------------------------- + +https://github.com/DanHarltey/Fastenshtein/blob/master/LICENSE + +The MIT License (MIT) + +Copyright (c) 2017 DanHartley + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/AcceptanceTesting/AcceptanceTestLoggerFactory.cs b/src/AcceptanceTesting/AcceptanceTestLoggerFactory.cs index 8a975444..5560ce60 100644 --- a/src/AcceptanceTesting/AcceptanceTestLoggerFactory.cs +++ b/src/AcceptanceTesting/AcceptanceTestLoggerFactory.cs @@ -6,6 +6,7 @@ public class AcceptanceTestLoggerFactory : ILoggerFactory public AcceptanceTestLoggerFactory(ScenarioContext scenarioContext) => this.scenarioContext = scenarioContext; public void AddProvider(ILoggerProvider provider) => throw new System.NotImplementedException(); + public ILogger CreateLogger(string categoryName) { return new ScenarioContextLogger(categoryName, scenarioContext); diff --git a/src/AcceptanceTesting/AcceptanceTesting.csproj b/src/AcceptanceTesting/AcceptanceTesting.csproj index 6a9269f2..3454fa3e 100644 --- a/src/AcceptanceTesting/AcceptanceTesting.csproj +++ b/src/AcceptanceTesting/AcceptanceTesting.csproj @@ -11,8 +11,7 @@ - - + diff --git a/src/AcceptanceTesting/BridgeComponent.cs b/src/AcceptanceTesting/BridgeComponent.cs index 7380f534..11edb735 100644 --- a/src/AcceptanceTesting/BridgeComponent.cs +++ b/src/AcceptanceTesting/BridgeComponent.cs @@ -53,11 +53,20 @@ public override async Task Start(CancellationToken cancellationToken = default) await host.StartAsync(cancellationToken).ConfigureAwait(false); } - public override async Task Stop() + public override async Task Stop(CancellationToken cancellationToken = default) { - if (host != null) + if (host is null) { - await host.StopAsync().ConfigureAwait(false); + return; + } + + try + { + await host.StopAsync(cancellationToken).ConfigureAwait(false); + } + finally + { + host.Dispose(); } } diff --git a/src/AcceptanceTests.ASB/AcceptanceTests.ASB.csproj b/src/AcceptanceTests.ASB/AcceptanceTests.ASB.csproj index 406b2c8a..4b61b5c6 100644 --- a/src/AcceptanceTests.ASB/AcceptanceTests.ASB.csproj +++ b/src/AcceptanceTests.ASB/AcceptanceTests.ASB.csproj @@ -6,12 +6,10 @@ - - - + diff --git a/src/AcceptanceTests.ASQ/AcceptanceTests.ASQ.csproj b/src/AcceptanceTests.ASQ/AcceptanceTests.ASQ.csproj index 52f4b2e7..4f8db421 100644 --- a/src/AcceptanceTests.ASQ/AcceptanceTests.ASQ.csproj +++ b/src/AcceptanceTests.ASQ/AcceptanceTests.ASQ.csproj @@ -6,12 +6,10 @@ - - - + diff --git a/src/AcceptanceTests.Learning/AcceptanceTests.Learning.csproj b/src/AcceptanceTests.Learning/AcceptanceTests.Learning.csproj index d96c7f60..85627afa 100644 --- a/src/AcceptanceTests.Learning/AcceptanceTests.Learning.csproj +++ b/src/AcceptanceTests.Learning/AcceptanceTests.Learning.csproj @@ -6,11 +6,6 @@ - - - - - diff --git a/src/AcceptanceTests.Msmq/AcceptanceTests.Msmq.csproj b/src/AcceptanceTests.Msmq/AcceptanceTests.Msmq.csproj index e402b63e..94e9931a 100644 --- a/src/AcceptanceTests.Msmq/AcceptanceTests.Msmq.csproj +++ b/src/AcceptanceTests.Msmq/AcceptanceTests.Msmq.csproj @@ -1,19 +1,16 @@ - + net8.0-windows + true + ..\NServiceBusTests.snk - - - - - diff --git a/src/AcceptanceTests.RabbitMQ/AcceptanceTests.RabbitMQ.csproj b/src/AcceptanceTests.RabbitMQ/AcceptanceTests.RabbitMQ.csproj index 568491f0..64d19a38 100644 --- a/src/AcceptanceTests.RabbitMQ/AcceptanceTests.RabbitMQ.csproj +++ b/src/AcceptanceTests.RabbitMQ/AcceptanceTests.RabbitMQ.csproj @@ -6,12 +6,10 @@ - - - + diff --git a/src/AcceptanceTests.RabbitMQ/ConnectionHelper.cs b/src/AcceptanceTests.RabbitMQ/ConnectionHelper.cs index a2f7ec94..125a62e6 100644 --- a/src/AcceptanceTests.RabbitMQ/ConnectionHelper.cs +++ b/src/AcceptanceTests.RabbitMQ/ConnectionHelper.cs @@ -17,7 +17,6 @@ public class ConnectionHelper var factory = new ConnectionFactory { AutomaticRecoveryEnabled = true, - UseBackgroundThreadsForIO = true, HostName = connectionStringParser.HostName, UserName = connectionStringParser.UserName ?? "guest", Password = connectionStringParser.Password ?? "guest", diff --git a/src/AcceptanceTests.SQS/AcceptanceTests.SQS.csproj b/src/AcceptanceTests.SQS/AcceptanceTests.SQS.csproj index fb93d268..a090f3b0 100644 --- a/src/AcceptanceTests.SQS/AcceptanceTests.SQS.csproj +++ b/src/AcceptanceTests.SQS/AcceptanceTests.SQS.csproj @@ -6,12 +6,10 @@ - - - + diff --git a/src/AcceptanceTests.SqlServer/AcceptanceTests.SqlServer.csproj b/src/AcceptanceTests.SqlServer/AcceptanceTests.SqlServer.csproj index d99abbc9..f7c40664 100644 --- a/src/AcceptanceTests.SqlServer/AcceptanceTests.SqlServer.csproj +++ b/src/AcceptanceTests.SqlServer/AcceptanceTests.SqlServer.csproj @@ -6,12 +6,10 @@ - - - + diff --git a/src/AcceptanceTests/.editorconfig b/src/AcceptanceTests/.editorconfig index 613ad2b9..8eb0958e 100644 --- a/src/AcceptanceTests/.editorconfig +++ b/src/AcceptanceTests/.editorconfig @@ -3,6 +3,7 @@ # Justification: Test project dotnet_diagnostic.CA2007.severity = none dotnet_diagnostic.PS0004.severity = none # A parameter of type CancellationToken on a private delegate or method should be required +dotnet_diagnostic.PS0014.severity = none # Add a CancellationToken parameter type argument dotnet_diagnostic.PS0018.severity = none # Add a CancellationToken parameter # Justification: Tests don't support cancellation and don't need to forward IMessageHandlerContext.CancellationToken diff --git a/src/AcceptanceTests/AcceptanceTests.csproj b/src/AcceptanceTests/AcceptanceTests.csproj index a88ccadf..84671715 100644 --- a/src/AcceptanceTests/AcceptanceTests.csproj +++ b/src/AcceptanceTests/AcceptanceTests.csproj @@ -6,11 +6,6 @@ - - - - - diff --git a/src/AcceptanceTests/Shared/Support/BridgeAcceptanceTest.cs b/src/AcceptanceTests/Shared/Support/BridgeAcceptanceTest.cs index dc56117d..36064c3b 100644 --- a/src/AcceptanceTests/Shared/Support/BridgeAcceptanceTest.cs +++ b/src/AcceptanceTests/Shared/Support/BridgeAcceptanceTest.cs @@ -2,7 +2,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using NServiceBus.AcceptanceTesting; using NServiceBus.Transport; using NUnit.Framework; diff --git a/src/AcceptanceTests/Shared/Support/DefaultServer.cs b/src/AcceptanceTests/Shared/Support/DefaultServer.cs index b9c5e3c9..051cae58 100644 --- a/src/AcceptanceTests/Shared/Support/DefaultServer.cs +++ b/src/AcceptanceTests/Shared/Support/DefaultServer.cs @@ -15,6 +15,7 @@ public virtual async Task GetConfiguration(RunDescriptor configuration.TypesToIncludeInScan(endpointConfiguration.GetTypesScopedByTestClass()); configuration.EnableInstallers(); + configuration.UseSerialization(); var recoverability = configuration.Recoverability(); recoverability.Delayed(delayed => delayed.NumberOfRetries(0)); diff --git a/src/AcceptanceTests/Shared/Support/DefaultTestServer.cs b/src/AcceptanceTests/Shared/Support/DefaultTestServer.cs index 88d745e0..c35088e8 100644 --- a/src/AcceptanceTests/Shared/Support/DefaultTestServer.cs +++ b/src/AcceptanceTests/Shared/Support/DefaultTestServer.cs @@ -16,6 +16,7 @@ public virtual async Task GetConfiguration(RunDescriptor configuration.TypesToIncludeInScan(endpointConfiguration.GetTypesScopedByTestClass()); configuration.EnableInstallers(); + configuration.UseSerialization(); var recoverability = configuration.Recoverability(); recoverability.Delayed(delayed => delayed.NumberOfRetries(0)); diff --git a/src/NServiceBus.MessagingBridge.Msmq/NServiceBus.MessagingBridge.Msmq.csproj b/src/NServiceBus.MessagingBridge.Msmq/NServiceBus.MessagingBridge.Msmq.csproj index 26b25048..3c3364bb 100644 --- a/src/NServiceBus.MessagingBridge.Msmq/NServiceBus.MessagingBridge.Msmq.csproj +++ b/src/NServiceBus.MessagingBridge.Msmq/NServiceBus.MessagingBridge.Msmq.csproj @@ -1,12 +1,14 @@ - + net8.0-windows + true + ..\NServiceBus.snk - - + + @@ -14,7 +16,7 @@ - + diff --git a/src/NServiceBus.MessagingBridge/Configuration/HostApplicationBuilderExtensions.cs b/src/NServiceBus.MessagingBridge/Configuration/HostApplicationBuilderExtensions.cs index 975d9b64..610663d2 100644 --- a/src/NServiceBus.MessagingBridge/Configuration/HostApplicationBuilderExtensions.cs +++ b/src/NServiceBus.MessagingBridge/Configuration/HostApplicationBuilderExtensions.cs @@ -1,10 +1,10 @@ namespace NServiceBus; using System; +using Logging; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using Logging; /// /// Extension methods to configure the bridge for the .NET hosted applications builder. @@ -14,8 +14,7 @@ public static class HostApplicationBuilderExtensions /// /// Configures the host to start the bridge. /// - public static IHostApplicationBuilder UseNServiceBusBridge(this IHostApplicationBuilder builder, - BridgeConfiguration bridgeConfiguration) + public static IHostApplicationBuilder UseNServiceBusBridge(this IHostApplicationBuilder builder, BridgeConfiguration bridgeConfiguration) { ArgumentNullException.ThrowIfNull(builder); ArgumentNullException.ThrowIfNull(bridgeConfiguration); @@ -23,8 +22,7 @@ public static IHostApplicationBuilder UseNServiceBusBridge(this IHostApplication var deferredLoggerFactory = new DeferredLoggerFactory(); LogManager.UseFactory(deferredLoggerFactory); - _ = builder.Services.AddSingleton(sp => - bridgeConfiguration.FinalizeConfiguration(sp.GetRequiredService>())) + _ = builder.Services.AddSingleton(sp => bridgeConfiguration.FinalizeConfiguration(sp.GetRequiredService>())) .AddSingleton(deferredLoggerFactory) .AddHostedService() .AddSingleton() diff --git a/src/NServiceBus.MessagingBridge/Configuration/HostBuilderExtensions.cs b/src/NServiceBus.MessagingBridge/Configuration/HostBuilderExtensions.cs index a0cb5c5e..82e9aceb 100644 --- a/src/NServiceBus.MessagingBridge/Configuration/HostBuilderExtensions.cs +++ b/src/NServiceBus.MessagingBridge/Configuration/HostBuilderExtensions.cs @@ -1,10 +1,10 @@ namespace NServiceBus; using System; +using Logging; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using Logging; /// /// Extension methods to configure the bridge for the .NET generic host. @@ -14,8 +14,7 @@ public static class HostBuilderExtensions /// /// Configures the host to start the bridge. /// - public static IHostBuilder UseNServiceBusBridge(this IHostBuilder hostBuilder, - Action bridgeConfigurationAction) + public static IHostBuilder UseNServiceBusBridge(this IHostBuilder hostBuilder, Action bridgeConfigurationAction) { ArgumentNullException.ThrowIfNull(hostBuilder); ArgumentNullException.ThrowIfNull(bridgeConfigurationAction); @@ -26,8 +25,7 @@ public static IHostBuilder UseNServiceBusBridge(this IHostBuilder hostBuilder, /// /// Configures the host to start the bridge. /// - public static IHostBuilder UseNServiceBusBridge(this IHostBuilder hostBuilder, - Action bridgeConfigurationAction) + public static IHostBuilder UseNServiceBusBridge(this IHostBuilder hostBuilder, Action bridgeConfigurationAction) { ArgumentNullException.ThrowIfNull(hostBuilder); ArgumentNullException.ThrowIfNull(bridgeConfigurationAction); @@ -41,8 +39,7 @@ public static IHostBuilder UseNServiceBusBridge(this IHostBuilder hostBuilder, bridgeConfigurationAction(hostBuilderContext, bridgeConfiguration); - serviceCollection.AddSingleton(sp => bridgeConfiguration.FinalizeConfiguration( - sp.GetRequiredService>())) + serviceCollection.AddSingleton(sp => bridgeConfiguration.FinalizeConfiguration(sp.GetRequiredService>())) .AddSingleton(deferredLoggerFactory) .AddHostedService() .AddSingleton() diff --git a/src/NServiceBus.MessagingBridge/CustomChecks/CustomChecksBackgroundService.cs b/src/NServiceBus.MessagingBridge/CustomChecks/CustomChecksBackgroundService.cs index cf7043d9..1c9afc6f 100644 --- a/src/NServiceBus.MessagingBridge/CustomChecks/CustomChecksBackgroundService.cs +++ b/src/NServiceBus.MessagingBridge/CustomChecks/CustomChecksBackgroundService.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -12,10 +11,7 @@ using ServiceControl.Plugin.CustomChecks.Messages; using Transport; -[SuppressMessage("Code", - "PS0003:A parameter of type CancellationToken on a non-private delegate or method should be optional")] -class CustomChecksBackgroundService - : BackgroundService +class CustomChecksBackgroundService : BackgroundService { public CustomChecksBackgroundService( FinalizedBridgeConfiguration bridgeConfiguration, @@ -25,7 +21,7 @@ public CustomChecksBackgroundService( this.customChecks = customChecks.ToList(); } - public override async Task StopAsync(CancellationToken cancellationToken) + public override async Task StopAsync(CancellationToken cancellationToken = default) { if (!customChecks.Any()) { @@ -36,7 +32,7 @@ public override async Task StopAsync(CancellationToken cancellationToken) } #pragma warning disable PS0017 - protected override async Task ExecuteAsync(CancellationToken stoppingToken) + protected override async Task ExecuteAsync(CancellationToken stoppingToken = default) #pragma warning restore PS0017 { if (!customChecks.Any()) diff --git a/src/NServiceBus.MessagingBridge/EndpointRegistry.cs b/src/NServiceBus.MessagingBridge/EndpointRegistry.cs index bbdfee2a..ae658bbd 100644 --- a/src/NServiceBus.MessagingBridge/EndpointRegistry.cs +++ b/src/NServiceBus.MessagingBridge/EndpointRegistry.cs @@ -41,7 +41,6 @@ public void ApplyMappings(IReadOnlyCollection transportConfigur targetEndpointAddressMappings[transportAddress] = registration.RawEndpoint.ToTransportAddress(new QueueAddress(endpoint.Name)); - targetEndpointDispatchers[registration.Endpoint.Name] = new TargetEndpointDispatcher( targetTransport.Name, proxyEndpoint, diff --git a/src/NServiceBus.MessagingBridge/Fastenshtein/LICENSE.md b/src/NServiceBus.MessagingBridge/Fastenshtein/LICENSE.md deleted file mode 100644 index 0b242d52..00000000 --- a/src/NServiceBus.MessagingBridge/Fastenshtein/LICENSE.md +++ /dev/null @@ -1,26 +0,0 @@ - -# Fastenshtein - -https://github.com/DanHarltey/Fastenshtein/blob/4f83ecc44b210fa398f118e38ca6986ebe804c10/LICENSE#L1 - -The MIT License (MIT) - -Copyright (c) 2017 DanHartley - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/NServiceBus.MessagingBridge/Fastenshtein/Levenshtein.cs b/src/NServiceBus.MessagingBridge/Fastenshtein/Levenshtein.cs index dc5372e7..953c29bb 100644 --- a/src/NServiceBus.MessagingBridge/Fastenshtein/Levenshtein.cs +++ b/src/NServiceBus.MessagingBridge/Fastenshtein/Levenshtein.cs @@ -29,7 +29,7 @@ public Levenshtein(string value) public int StoredLength => storedValue.Length; /// - /// Compares a value to the stored value. + /// Compares a value to the stored value. /// Not thread safe. /// /// Difference. 0 complete match. @@ -77,7 +77,7 @@ public int DistanceFrom(string value) ++currentCost; } - /* + /* * Improvement on the older versions. * Swapping the variables here results in a performance improvement for modern intel CPU’s, but I have no idea why? */ diff --git a/src/NServiceBus.MessagingBridge/NServiceBus.MessagingBridge.csproj b/src/NServiceBus.MessagingBridge/NServiceBus.MessagingBridge.csproj index 6ca70983..a87ef685 100644 --- a/src/NServiceBus.MessagingBridge/NServiceBus.MessagingBridge.csproj +++ b/src/NServiceBus.MessagingBridge/NServiceBus.MessagingBridge.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/NServiceBus.MessagingBridge/RawEndpoints/ExceptionHeaderHelper.cs b/src/NServiceBus.MessagingBridge/RawEndpoints/ExceptionHeaderHelper.cs index b571be0d..b2b9e3a8 100644 --- a/src/NServiceBus.MessagingBridge/RawEndpoints/ExceptionHeaderHelper.cs +++ b/src/NServiceBus.MessagingBridge/RawEndpoints/ExceptionHeaderHelper.cs @@ -32,13 +32,10 @@ public static void SetExceptionHeaders(Dictionary headers, Excep headers[ExceptionInfoStackTrace] = e.ToString(); headers[TimeOfFailure] = DateTimeOffsetHelper.ToWireFormattedString(DateTimeOffset.UtcNow); - // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (e.Data == null) - // ReSharper disable HeuristicUnreachableCode { return; } - // ReSharper restore HeuristicUnreachableCode foreach (DictionaryEntry entry in e.Data) { diff --git a/src/UnitTests/ExceptionHeaderHelperFixture.cs b/src/UnitTests/ExceptionHeaderHelperFixture.cs index 92b1228c..63f015dc 100644 --- a/src/UnitTests/ExceptionHeaderHelperFixture.cs +++ b/src/UnitTests/ExceptionHeaderHelperFixture.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using NServiceBus.Logging; using NServiceBus.Raw; using NUnit.Framework; diff --git a/src/UnitTests/UnitTests.csproj b/src/UnitTests/UnitTests.csproj index b224b726..a42f6cd3 100644 --- a/src/UnitTests/UnitTests.csproj +++ b/src/UnitTests/UnitTests.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -10,13 +10,17 @@ + + + + + + - -