fix: avoid Sonar culture-sensitive ToString warning on nullable string concatenation - #1094
Merged
Merged
Conversation
vbreuss
enabled auto-merge (squash)
September 25, 2026 21:03
Test Results 62 files ±0 62 suites ±0 1h 17m 16s ⏱️ + 1m 16s For more details on these failures, see this check. Results for commit 6c6e056. ± Comparison against base commit 015a573. This pull request removes 60104 and adds 60100 tests. Note that renamed tests count towards both.This pull request removes 6743 skipped tests and adds 6743 skipped tests. Note that renamed tests count towards both. |
…onHelpers Looking up mock handles by reference instead of by their value removes the need for DangerousGetHandle, and extracting the per-entry release lowers the cognitive complexity of ReleaseClosedHandles.
vbreuss
force-pushed
the
fix/sonar-culture-sensitive-tostring
branch
from
September 27, 2026 10:05
6c6e056 to
ef4ba13
Compare
vbreuss
disabled auto-merge
September 27, 2026 10:25
vbreuss
enabled auto-merge (squash)
September 27, 2026 10:25
|
|
This is addressed in release v7.1.0. |
This was referenced Sep 28, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes several Sonar findings.
ToString: Sonar flagsstring.Concatwhen it is given nullable strings, soDirectoryMockandAssertionHelpersuse plain+concatenation instead.SafeHandle.DangerousGetHandle(blocker):MockSafeFileHandleRegistrynow looks up mock handles by reference (ConditionalWeakTable) instead of by their raw value. The raw value is never read, and a handle that is never disposed is still released once it is garbage-collected.ReleaseClosedHandlesis now a separate method.ReplacewithoutStringComparison:AssertionHelpersuses the ordinal overload where it exists (not onnetstandard2.0).