From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Sat, 26 Aug 2023 00:51:18 +0000 (-0700) Subject: Update analyzers (#4188) X-Git-Tag: accepted/tizen/unified/riscv/20231226.055542~37^2^2~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d609ce8b00da00f5134285bf6ec1f8999cd0e1a1;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Update analyzers (#4188) --- diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 81280ad2f..b2189ed98 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -60,13 +60,13 @@ https://github.com/dotnet/roslyn 6acaa7b7c0efea8ea292ca26888c0346fbf8b0c1 - + https://github.com/dotnet/roslyn-analyzers - c6352bf2e1bd214fce090829de1042000d021497 + 76d99c5f3e11f0600fae074270c0d89042c360f0 - + https://github.com/dotnet/roslyn-analyzers - c6352bf2e1bd214fce090829de1042000d021497 + 76d99c5f3e11f0600fae074270c0d89042c360f0 diff --git a/eng/Versions.props b/eng/Versions.props index d36f1541b..2d46e6db5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,8 +80,8 @@ 4.4.0 4.4.0 $(MicrosoftCodeAnalysisVersion) - 3.3.5-beta1.23124.1 - 8.0.0-preview1.23124.1 + 3.11.0-beta1.23420.2 + 8.0.0-preview.23420.2 @@ -92,8 +92,8 @@ Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure they do not break the local dev experience. --> - 4.6.0-1.23073.4 - 4.6.0-1.23073.4 - 4.6.0-1.23073.4 + 4.8.0-2.23422.14 + 4.8.0-2.23422.14 + 4.8.0-2.23422.14 diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs index 04325022b..11b2308e2 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs @@ -30,7 +30,7 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation public Runtime(IServiceProvider services, int id, ClrInfo clrInfo) { - Target = services.GetService() ?? throw new ArgumentNullException(nameof(Target), "Uninitialized service"); + Target = services.GetService() ?? throw new NullReferenceException($"Uninitialized service: {nameof(Target)}"); Id = id; _clrInfo = clrInfo ?? throw new ArgumentNullException(nameof(clrInfo)); _symbolService = services.GetService(); diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/ThreadPoolQueueCommand.cs b/src/Microsoft.Diagnostics.ExtensionCommands/ThreadPoolQueueCommand.cs index 1a0bd35d5..bee1b08f4 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/ThreadPoolQueueCommand.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/ThreadPoolQueueCommand.cs @@ -89,8 +89,7 @@ namespace Microsoft.Diagnostics.ExtensionCommands { count++; - WorkInfo wi; - if (!stats.ContainsKey(statName)) + if (!stats.TryGetValue(statName, out WorkInfo wi)) { wi = new WorkInfo() { @@ -99,10 +98,6 @@ namespace Microsoft.Diagnostics.ExtensionCommands }; stats[statName] = wi; } - else - { - wi = stats[statName]; - } wi.Count++; } diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTcpSocketEndPoint.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTcpSocketEndPoint.cs index 84e713d32..7aaae390f 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTcpSocketEndPoint.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTcpSocketEndPoint.cs @@ -55,7 +55,7 @@ namespace Microsoft.Diagnostics.NETCore.Client { // Host can contain wildcard (*) that is a reserved charachter in URI's. // Replace with dummy localhost representation just for parsing purpose. - if (endPoint.IndexOf("//*", StringComparison.Ordinal) != -1) + if (endPoint.Contains("//*")) { usesWildcardHost = true; uriToParse = endPoint.Replace("//*", "//localhost"); diff --git a/src/Microsoft.Diagnostics.WebSocketServer/WebSocketServerImpl.cs b/src/Microsoft.Diagnostics.WebSocketServer/WebSocketServerImpl.cs index 566b8e03c..f34e5907c 100644 --- a/src/Microsoft.Diagnostics.WebSocketServer/WebSocketServerImpl.cs +++ b/src/Microsoft.Diagnostics.WebSocketServer/WebSocketServerImpl.cs @@ -162,7 +162,7 @@ public class WebSocketServerImpl : IWebSocketServer string uriToParse; // Host can contain wildcard (*) that is a reserved charachter in URI's. // Replace with dummy localhost representation just for parsing purpose. - if (endPoint.IndexOf("//*", StringComparison.Ordinal) != -1) + if (endPoint.Contains("//*")) { // FIXME: This is a workaround for the fact that Uri.Host is not set for wildcard host. throw new ArgumentException("Wildcard host is not supported for WebSocket endpoints");