Update analyzers (#4188)
authorJuan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Sat, 26 Aug 2023 00:51:18 +0000 (17:51 -0700)
committerGitHub <noreply@github.com>
Sat, 26 Aug 2023 00:51:18 +0000 (17:51 -0700)
eng/Version.Details.xml
eng/Versions.props
src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs
src/Microsoft.Diagnostics.ExtensionCommands/ThreadPoolQueueCommand.cs
src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTcpSocketEndPoint.cs
src/Microsoft.Diagnostics.WebSocketServer/WebSocketServerImpl.cs

index 81280ad2f8224f2b1a264792531db44c422c4fd2..b2189ed98ccb0a3d15eccfba3eba17acc77c16bf 100644 (file)
       <Uri>https://github.com/dotnet/roslyn</Uri>
       <Sha>6acaa7b7c0efea8ea292ca26888c0346fbf8b0c1</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23124.1">
+    <Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.23420.2">
       <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
-      <Sha>c6352bf2e1bd214fce090829de1042000d021497</Sha>
+      <Sha>76d99c5f3e11f0600fae074270c0d89042c360f0</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview1.23124.1">
+    <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23420.2">
       <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
-      <Sha>c6352bf2e1bd214fce090829de1042000d021497</Sha>
+      <Sha>76d99c5f3e11f0600fae074270c0d89042c360f0</Sha>
     </Dependency>
   </ToolsetDependencies>
 </Dependencies>
index d36f1541b172515bcfc008bc67b90b782c463300..2d46e6db5b23c8e9174cc26d185b0ac736184eab 100644 (file)
@@ -80,8 +80,8 @@
     <MicrosoftCodeAnalysisVersion_4_4>4.4.0</MicrosoftCodeAnalysisVersion_4_4>
     <MicrosoftCodeAnalysisVersion_LatestVS>4.4.0</MicrosoftCodeAnalysisVersion_LatestVS>
     <MicrosoftCodeAnalysisVersion_LatestVS Condition="'$(DotNetBuildFromSource)' == 'true'">$(MicrosoftCodeAnalysisVersion)</MicrosoftCodeAnalysisVersion_LatestVS>
-    <MicrosoftCodeAnalysisAnalyzersVersion>3.3.5-beta1.23124.1</MicrosoftCodeAnalysisAnalyzersVersion>
-    <MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview1.23124.1</MicrosoftCodeAnalysisNetAnalyzersVersion>
+    <MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.23420.2</MicrosoftCodeAnalysisAnalyzersVersion>
+    <MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview.23420.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
     <!--
       These packages affect the design-time experience in VS, so we update them at the same cadance as the MicrosoftCodeAnalysisVersion_LatestVS version.
     -->
@@ -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.
     -->
-    <MicrosoftCodeAnalysisCSharpVersion>4.6.0-1.23073.4</MicrosoftCodeAnalysisCSharpVersion>
-    <MicrosoftCodeAnalysisVersion>4.6.0-1.23073.4</MicrosoftCodeAnalysisVersion>
-    <MicrosoftNetCompilersToolsetVersion>4.6.0-1.23073.4</MicrosoftNetCompilersToolsetVersion>
+    <MicrosoftCodeAnalysisCSharpVersion>4.8.0-2.23422.14</MicrosoftCodeAnalysisCSharpVersion>
+    <MicrosoftCodeAnalysisVersion>4.8.0-2.23422.14</MicrosoftCodeAnalysisVersion>
+    <MicrosoftNetCompilersToolsetVersion>4.8.0-2.23422.14</MicrosoftNetCompilersToolsetVersion>
   </PropertyGroup>
 </Project>
index 04325022be98ba59dbf6cd3d163b3c61a7639dbe..11b2308e2f3555abdb9e93e89879eb310e22c801 100644 (file)
@@ -30,7 +30,7 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
 
         public Runtime(IServiceProvider services, int id, ClrInfo clrInfo)
         {
-            Target = services.GetService<ITarget>() ?? throw new ArgumentNullException(nameof(Target), "Uninitialized service");
+            Target = services.GetService<ITarget>() ?? throw new NullReferenceException($"Uninitialized service: {nameof(Target)}");
             Id = id;
             _clrInfo = clrInfo ?? throw new ArgumentNullException(nameof(clrInfo));
             _symbolService = services.GetService<ISymbolService>();
index 1a0bd35d5f11cdc6d21492b1b1393b7a15a50fec..bee1b08f44b52854c7d22928a3e714d6ba8d0f06 100644 (file)
@@ -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++;
         }
index 84e713d32069ab0253a4eb4f0b11d3f016e12ae2..7aaae390f5879ffc4b5f09914e20aa26fa8c5800 100644 (file)
@@ -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");
index 566b8e03cb8ae30edd0f103307ad9f1097361192..f34e5907ce2557adc36adc16d68b8626b685fae1 100644 (file)
@@ -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");