Re-enable CA1802 (use consts instead of readonly statics) (dotnet/coreclr#39782)
authorStephen Toub <stoub@microsoft.com>
Fri, 26 Jul 2019 02:02:21 +0000 (22:02 -0400)
committerStephen Toub <stoub@microsoft.com>
Fri, 26 Jul 2019 21:17:17 +0000 (17:17 -0400)
* Re-enable CA1802 (use consts instead of readonly statics)

I enabled it only for privates and internals, as we've previously violated this in public surface area, and as everything goes through API review moving forward, didn't seem worthwhile fighting it and adding suppressions in various places.

* Address PR feedback

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/c5b60182397bbdd0033d6627cc075dfea59a5a34

src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

index be51c6880ed4426ab8d593cba028143e2ff94875..b0bfdca324685489bb6686c6989c451d0c37ec1a 100644 (file)
@@ -2518,7 +2518,7 @@ namespace System.Diagnostics.Tracing
             return eventData.Parameters[parameterId].ParameterType;
         }
 
-        private static readonly bool m_EventSourcePreventRecursion = false;
+        private const bool m_EventSourcePreventRecursion = false;
 #else
         private int GetParameterCount(EventMetadata eventData)
         {