Re-enable CA1823 (unused private fields) (dotnet/corefx#39899)
authorStephen Toub <stoub@microsoft.com>
Wed, 31 Jul 2019 12:04:33 +0000 (08:04 -0400)
committerGitHub <noreply@github.com>
Wed, 31 Jul 2019 12:04:33 +0000 (08:04 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/e5d38a54cf21f6427ae4fe99c3841c8067139e75

134 files changed:
src/libraries/CodeAnalysis.ruleset
src/libraries/Common/src/Interop/FreeBSD/Interop.Process.cs
src/libraries/Common/src/Interop/OSX/Interop.libproc.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SecKeyRef.Export.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs
src/libraries/Common/src/Interop/Unix/System.Native/Interop.MulticastOption.cs
src/libraries/Common/src/Interop/Windows/HttpApi/Interop.HttpApi.cs
src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
src/libraries/Common/src/System/Data/Common/DbConnectionOptions.Common.cs
src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs
src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs
src/libraries/Common/src/System/Net/Logging/NetEventSource.Common.cs
src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs
src/libraries/Common/src/System/Resources/ResourceWriter.cs
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft.VisualBasic.Core.vbproj
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/Utils.LateBinder.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Conversion.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb
src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj
src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs
src/libraries/System.Collections.NonGeneric/src/System/Collections/Queue.cs
src/libraries/System.Collections.NonGeneric/src/System/Collections/SortedList.cs
src/libraries/System.Collections/src/System/Collections/BitArray.cs
src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs
src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionException.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ExportfactoryCreator.LifetimeContext.cs
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs
src/libraries/System.Composition.Convention/src/System/Composition/Convention/ConventionBuilder.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/AppSettingsReader.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationErrorsException.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DpapiProtectedConfigurationProvider.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SettingElement.cs
src/libraries/System.Data.Common/src/System/Data/DataTable.cs
src/libraries/System.Data.Odbc/src/Common/System/Data/Common/DBConnectionString.cs
src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs
src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolIdentity.cs
src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbMetaDataFactory.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNINpHandle.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNIProxy.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnectionFactory.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlDependency.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlMetadataFactory.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.Windows.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/TdsParserStateObjectFactory.Windows.cs
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.DateTime.netfx.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLog.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogEntry.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogInternal.cs
src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryServer.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Forest.cs
src/libraries/System.Drawing.Common/src/System/Drawing/BufferedGraphicsContext.Windows.cs
src/libraries/System.Drawing.Common/src/System/Drawing/BufferedGraphicsContext.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageFormat.cs
src/libraries/System.Drawing.Common/src/misc/DpiHelper.cs
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.PackUriScheme.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/PackUriHelper.cs
src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipPackage.cs
src/libraries/System.IO.Ports/src/System/IO/Ports/SerialPort.cs
src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs
src/libraries/System.Management/src/System/Management/ManagementBaseObject.cs
src/libraries/System.Management/src/System/Management/WMIGenerator.cs
src/libraries/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpEnvironmentProxy.Unix.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpEnvironmentProxy.cs
src/libraries/System.Net.Http/src/uap/System/Net/HttpClientHandler.cs
src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs
src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpResponseStreamAsyncResult.cs
src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/HttpWebSocket.Windows.cs
src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.Auth.cs
src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj
src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.Windows.cs
src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.cs
src/libraries/System.Net.Requests/src/System/Net/CommandStream.cs
src/libraries/System.Net.Requests/src/System/Net/HttpWebRequest.cs
src/libraries/System.Net.Security/src/System/Net/NTAuthentication.cs
src/libraries/System.Net.Security/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicy.cs
src/libraries/System.Net.Sockets/src/System/Net/Sockets/NetEventSource.Sockets.cs
src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/WinRTWebSocket.cs
src/libraries/System.Private.Uri/src/System/UriHelper.cs
src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/SqlUtils.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriter.cs
src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/AutoValidator.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/FacetChecker.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaSetCompiler.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILModule.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilValidationVisitor.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/NumberFormatter.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQuerySequence.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlQueryTypeFactory.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/CopyNamespacesAction.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NumberAction.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ProcessingInstructionAction.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/SequentialOutput.cs
src/libraries/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/IL/MethodBodyBlock.cs
src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/GetTypeCoreCache.cs
src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/Modules/RoModule.Unifier.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Dbg.cs
src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Unix.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs
src/libraries/System.Runtime.WindowsRuntime/src/System/Runtime/InteropServices/WindowsRuntime/MarshalingHelpers.cs
src/libraries/System.Security.Claims/src/System/Security/Claims/ClaimsIdentity.cs
src/libraries/System.Security.Cryptography.Cng/src/Internal/Cryptography/SymmetricImportExportExtensions.cs
src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISCIIEncoding.cs
src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.Escaping.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCharClass.cs
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs
src/libraries/System.Threading/src/System/Threading/CDSsyncETWBCLProvider.cs
src/libraries/System.Transactions.Local/src/System/Transactions/TransactionTable.cs

index e0fdf5a..da3caf1 100644 (file)
@@ -50,7 +50,6 @@
     <Rule Id="CA1819" Action="None" /> <!-- Properties should not return arrays -->
     <Rule Id="CA1820" Action="None" /> <!-- Test for empty strings using string length -->
     <Rule Id="CA1822" Action="None" /> <!-- Mark members as static -->
-    <Rule Id="CA1823" Action="None" /> <!-- Avoid unused private fields -->
     <Rule Id="CA1827" Action="None" /> <!-- Do not use Count() when Any() can be used -->
     <Rule Id="CA2000" Action="None" /> <!-- Dispose objects before losing scope -->
     <Rule Id="CA2010" Action="None" /> <!-- Always consume the value returned by methods marked with PreserveSigAttribute -->
index 2359c33..8978e49 100644 (file)
@@ -8,6 +8,7 @@ using System.ComponentModel;
 using System.Diagnostics;
 using System.Runtime.InteropServices;
 
+#pragma warning disable CA1823 // analyzer incorrectly flags fixed buffer length const (https://github.com/dotnet/roslyn-analyzers/issues/2724)
 
 internal static partial class Interop
 {
index fd51460..381e57b 100644 (file)
@@ -8,6 +8,7 @@ using System.ComponentModel;
 using System.Diagnostics;
 using System.Runtime.InteropServices;
 
+#pragma warning disable CA1823 // analyzer incorrectly flags fixed buffer length const (https://github.com/dotnet/roslyn-analyzers/issues/2724)
 
 internal static partial class Interop
 {
index 374ca9c..3c3345b 100644 (file)
@@ -13,16 +13,8 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
-        private const string OidPbes2 = "1.2.840.113549.1.5.13";
-        private const string OidPbkdf2 = "1.2.840.113549.1.5.12";
-        private const string OidSha1 = "1.3.14.3.2.26";
-        private const string OidTripleDesCbc = "1.2.840.113549.3.7";
-
         private static readonly SafeCreateHandle s_nullExportString = new SafeCreateHandle();
 
-        private static readonly SafeCreateHandle s_emptyExportString =
-            CoreFoundation.CFStringCreateWithCString("");
-
         [DllImport(Libraries.AppleCryptoNative)]
         private static extern int AppleCryptoNative_SecKeyExport(
             SafeSecKeyRefHandle key,
index d8e591c..648a1a2 100644 (file)
@@ -305,7 +305,7 @@ internal static partial class Interop
             {
                 if (protocols.Count == 1 && protocols[0] == SslApplicationProtocol.Http2)
                 {
-                    cfProtocolsRefs = s_cfAlpnHttp211Protocols;
+                    cfProtocolsRefs = s_cfAlpnHttp2Protocols;
                 }
                 else if (protocols.Count == 1 && protocols[0] == SslApplicationProtocol.Http11)
                 {
index 88dffd9..85b3d29 100644 (file)
@@ -15,6 +15,9 @@ internal static partial class Interop
 {
     internal static partial class AppleCrypto
     {
+        private static readonly SafeCreateHandle s_emptyExportString =
+            CoreFoundation.CFStringCreateWithCString("");
+
         [DllImport(Libraries.AppleCryptoNative)]
         private static extern int AppleCryptoNative_X509ImportCertificate(
             byte[] pbKeyBlob,
index b676eaa..307e704 100644 (file)
@@ -4,6 +4,8 @@
 
 using System.Runtime.InteropServices;
 
+#pragma warning disable CA1823 // unused private padding fields in MulticastOption structs
+
 internal static partial class Interop
 {
     internal static partial class Sys
@@ -12,7 +14,7 @@ internal static partial class Interop
         {
             public IPAddress Address;  // Destination IP Address
             public int InterfaceIndex; // Interface index
-            private int Padding;       // Pad out to 8-byte alignment
+            private int _padding;       // Pad out to 8-byte alignment
         }
 
         [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")]
index 8a12048..d208acd 100644 (file)
@@ -2,10 +2,10 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System;
-using System.Diagnostics;
 using System.Runtime.InteropServices;
 
+#pragma warning disable CA1823 // unused private padding fields in MulticastOption structs
+
 internal static partial class Interop
 {
     internal static partial class Sys
index 19c5741..1684b5c 100644 (file)
@@ -363,7 +363,6 @@ internal static partial class Interop
         }
 
         private const int HttpHeaderRequestMaximum = (int)HttpRequestHeader.UserAgent + 1;
-        private const int HttpHeaderResponseMaximum = (int)HttpResponseHeader.WwwAuthenticate + 1;
 
         internal static class HTTP_REQUEST_HEADER_ID
         {
index ae8a526..f2a14ec 100644 (file)
@@ -156,8 +156,6 @@ namespace System.Net.Security
             this.handle = value;
         }
 
-        private const uint CRYPT_ACQUIRE_SILENT_FLAG = 0x00000040;
-
         protected override bool ReleaseHandle()
         {
             Interop.Crypt32.CertFreeCertificateContext(handle);
index 66f90e2..9cca4cc 100644 (file)
@@ -65,17 +65,15 @@ namespace System.Data.Common
         private static readonly Regex s_connectionStringRegex = new Regex(ConnectionStringPattern, RegexOptions.ExplicitCapture | RegexOptions.Compiled);
         private static readonly Regex s_connectionStringRegexOdbc = new Regex(ConnectionStringPatternOdbc, RegexOptions.ExplicitCapture | RegexOptions.Compiled);
 #endif
-        private const string ConnectionStringValidKeyPattern = "^(?![;\\s])[^\\p{Cc}]+(?<!\\s)$"; // key not allowed to start with semi-colon or space or contain non-visible characters or end with space
-        private const string ConnectionStringValidValuePattern = "^[^\u0000]*$";                    // value not allowed to contain embedded null
-        private const string ConnectionStringQuoteValuePattern = "^[^\"'=;\\s\\p{Cc}]*$";           // generally do not quote the value if it matches the pattern
-        private const string ConnectionStringQuoteOdbcValuePattern = "^\\{([^\\}\u0000]|\\}\\})*\\}$"; // do not quote odbc value if it matches this pattern
         internal const string DataDirectory = "|datadirectory|";
 
-        private static readonly Regex s_connectionStringValidKeyRegex = new Regex(ConnectionStringValidKeyPattern, RegexOptions.Compiled);
-        private static readonly Regex s_connectionStringValidValueRegex = new Regex(ConnectionStringValidValuePattern, RegexOptions.Compiled);
+#pragma warning disable CA1823 // used in some compilations and not others
+        private static readonly Regex s_connectionStringValidKeyRegex = new Regex("^(?![;\\s])[^\\p{Cc}]+(?<!\\s)$", RegexOptions.Compiled); // key not allowed to start with semi-colon or space or contain non-visible characters or end with space
+        private static readonly Regex s_connectionStringValidValueRegex = new Regex("^[^\u0000]*$", RegexOptions.Compiled); // value not allowed to contain embedded null
 
-        private static readonly Regex s_connectionStringQuoteValueRegex = new Regex(ConnectionStringQuoteValuePattern, RegexOptions.Compiled);
-        private static readonly Regex s_connectionStringQuoteOdbcValueRegex = new Regex(ConnectionStringQuoteOdbcValuePattern, RegexOptions.ExplicitCapture | RegexOptions.Compiled);
+        private static readonly Regex s_connectionStringQuoteValueRegex = new Regex("^[^\"'=;\\s\\p{Cc}]*$", RegexOptions.Compiled); // generally do not quote the value if it matches the pattern
+        private static readonly Regex s_connectionStringQuoteOdbcValueRegex = new Regex("^\\{([^\\}\u0000]|\\}\\})*\\}$", RegexOptions.ExplicitCapture | RegexOptions.Compiled); // do not quote odbc value if it matches this pattern
+#pragma warning restore CA1823
 
         // connection string common keywords
         private static class KEY
index 81e2d8a..61ea933 100644 (file)
@@ -11,7 +11,6 @@ namespace System.Data.ProviderBase
 {
     internal class DbMetaDataFactory
     {
-
         private DataSet _metaDataCollectionsDataSet;
         private string _normalizedServerVersion;
         private string _serverVersionString;
@@ -23,7 +22,6 @@ namespace System.Data.ProviderBase
         private const string _minimumVersion = "MinimumVersion";
         private const string _dataSourceProductVersionNormalized = "DataSourceProductVersionNormalized";
         private const string _dataSourceProductVersion = "DataSourceProductVersion";
-        private const string _restrictionDefault = "RestrictionDefault";
         private const string _restrictionNumber = "RestrictionNumber";
         private const string _numberOfRestrictions = "NumberOfRestrictions";
         private const string _restrictionName = "RestrictionName";
index bdf79c6..fe63683 100644 (file)
@@ -290,8 +290,6 @@ namespace System.Globalization
 
             internal const int DECIMAL_PRECISION = 29; // Decimal.DecCalc also uses this value
 
-            private const int MIN_SB_BUFFER_SIZE = 105;
-
             private static bool IsWhite(char ch)
             {
                 return (((ch) == 0x20) || ((ch) >= 0x09 && (ch) <= 0x0D));
index 6d3b94e..7c79913 100644 (file)
@@ -17,6 +17,8 @@ using System.Runtime.InteropServices;
 using System.Security;
 #endif
 
+#pragma warning disable CA1823 // not all IDs are used by all partial providers
+
 namespace System.Net
 {
     // Implementation:
index 1337614..24911ad 100644 (file)
@@ -52,8 +52,10 @@ namespace System.Net.WebSockets
         /// <summary>Valid states to be in when calling CloseAsync.</summary>
         private static readonly WebSocketState[] s_validCloseStates = { WebSocketState.Open, WebSocketState.CloseReceived, WebSocketState.CloseSent };
 
+#pragma warning disable CA1823 // not used by System.Net.WebSockets.WebSocketProtocol.dll
         /// <summary>Successfully completed task representing a close message.</summary>
         private static readonly Task<WebSocketReceiveResult> s_cachedCloseTask = Task.FromResult(new WebSocketReceiveResult(0, WebSocketMessageType.Close, true));
+#pragma warning restore CA1823
 
         /// <summary>The maximum size in bytes of a message frame header that includes mask bytes.</summary>
         internal const int MaxMessageHeaderLength = 14;
index 96c27e3..2eea8c6 100644 (file)
@@ -45,7 +45,6 @@ namespace System.Resources
     {
         // An initial size for our internal sorted list, to avoid extra resizes.
         private const int AverageNameSize = 20 * 2;  // chars in little endian Unicode
-        private const int AverageValueSize = 40;
         internal const string ResourceReaderFullyQualifiedName = "System.Resources.ResourceReader, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
         private const string ResSetTypeName = "System.Resources.RuntimeResourceSet";
         private const int ResSetVersion = 2;
index 6ec2c72..0a0410e 100644 (file)
@@ -11,6 +11,7 @@
     <WarningsNotAsErrors>42025</WarningsNotAsErrors>
     <DefineConstants>$(DefineConstants),LATEBINDING=True</DefineConstants>
     <DefineConstants Condition="'$(TargetsWindows)' == 'true'">$(DefineConstants),PLATFORM_WINDOWS=True</DefineConstants>
+    <NoWarn Condition="'$(TargetsWindows)' != 'true'">$(NoWarn);CA1823</NoWarn> <!-- Avoid unused fields warnings in Unix build -->
     <AssemblyName>Microsoft.VisualBasic.Core</AssemblyName>
     <NoStdLib>true</NoStdLib>
     <RemoveIntegerChecks>false</RemoveIntegerChecks>
index 54b99ab..ccd16fc 100644 (file)
@@ -44,8 +44,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
 
         Friend Const OptionCompareTextFlags As CompareOptions = (CompareOptions.IgnoreCase Or CompareOptions.IgnoreWidth Or CompareOptions.IgnoreKanaType)
 
-        Private Shared ReadOnly s_resourceManagerSyncObj As Object = New Object
-
         Friend Shared m_achIntlSpace() As Char = {chSpace, chIntlSpace}
         Private Shared ReadOnly s_voidType As Type = System.Type.GetType("System.Void")
         Private Shared s_VBRuntimeAssembly As System.Reflection.Assembly
index f3f00fe..790f413 100644 (file)
@@ -13,35 +13,18 @@ Namespace Microsoft.VisualBasic
 
     Public Module Conversion
 
-        Private Const NUMPRS_LEADING_WHITE As Integer = &H1I
-        Private Const NUMPRS_TRAILING_WHITE As Integer = &H2I
         Private Const NUMPRS_LEADING_PLUS As Integer = &H4I
-        Private Const NUMPRS_TRAILING_PLUS As Integer = &H8I
         Private Const NUMPRS_LEADING_MINUS As Integer = &H10I
-        Private Const NUMPRS_TRAILING_MINUS As Integer = &H20I
         Private Const NUMPRS_HEX_OCT As Integer = &H40I
-        Private Const NUMPRS_PARENS As Integer = &H80I
         Private Const NUMPRS_DECIMAL As Integer = &H100I
-        Private Const NUMPRS_THOUSANDS As Integer = &H200I
-        Private Const NUMPRS_CURRENCY As Integer = &H400I
         Private Const NUMPRS_EXPONENT As Integer = &H800I
-        Private Const NUMPRS_USE_ALL As Integer = &H1000I
-        Private Const NUMPRS_STD As Integer = &H1FFFI
-
-        ' flags used by dwOutFlags only:
-        '
-        Private Const NUMPRS_NEG As Integer = &H10000I
-        Private Const NUMPRS_INEXACT As Integer = &H20000I
 
         ' flags used by VarNumFromParseNum to indicate acceptable result types:
         '
-        Private Const VTBIT_EMPTY As Integer = &H0
-        Private Const VTBIT_NULL As Integer = &H2
         Private Const VTBIT_I2 As Integer = &H4
         Private Const VTBIT_I4 As Integer = &H8
         Private Const VTBIT_R4 As Integer = &H10
         Private Const VTBIT_R8 As Integer = &H20
-        Private Const VTBIT_CY As Integer = &H40
         Private Const VTBIT_DATE As Integer = &H80
         Private Const VTBIT_BSTR As Integer = &H100
         Private Const VTBIT_OBJECT As Integer = &H200
@@ -59,7 +42,6 @@ Namespace Microsoft.VisualBasic
         Private Const LCID_US_ENGLISH As Integer = &H409I
         Private Const PRSFLAGS As Integer _
             = (NUMPRS_LEADING_PLUS Or NUMPRS_LEADING_MINUS Or NUMPRS_HEX_OCT Or NUMPRS_DECIMAL Or NUMPRS_EXPONENT)
-        'Private Const VTBITS As Integer = (VTBIT_I2 Or VTBIT_I4 Or VTBIT_R8 Or VTBIT_CY Or VTBIT_DECIMAL)
         Private Const VTBITS As Integer = (VTBIT_I2 Or VTBIT_I4 Or VTBIT_R8 Or VTBIT_DECIMAL)
 
         Private Const TYPE_INDICATOR_INT16 As Char = "%"c
@@ -1079,9 +1061,7 @@ NextOctCharacter:
         Private Function ShiftVTBits(ByVal vt As Integer) As Integer
             Select Case vt
                 'Case VariantType.Empty     
-                'Fall through VTBIT_EMPTY
                 'Case VariantType.Null
-                'Fall through VTBIT_NULL
                 Case VariantType.Short
                     Return VTBIT_I2
                 Case VariantType.Integer
index 9d61915..f83474f 100644 (file)
@@ -18,11 +18,7 @@ Namespace Microsoft.VisualBasic
 
     Public Module FileSystem
 
-        Private Const ERROR_ACCESS_DENIED As Integer = 5
         Private Const ERROR_FILE_NOT_FOUND As Integer = 2
-        Private Const ERROR_BAD_NETPATH As Integer = 53
-        Private Const ERROR_INVALID_PARAMETER As Integer = 87
-        Private Const ERROR_WRITE_PROTECT As Integer = 19
         Private Const ERROR_FILE_EXISTS As Integer = 80
         Private Const ERROR_ALREADY_EXISTS As Integer = 183
         Private Const ERROR_INVALID_ACCESS As Integer = 12
@@ -37,15 +33,6 @@ Namespace Microsoft.VisualBasic
         Friend Const FIRST_LOCAL_CHANNEL As Integer = 1
         Friend Const LAST_LOCAL_CHANNEL As Integer = 255
 
-        Private Const A_NORMAL As Integer = &H0I
-        Private Const A_RDONLY As Integer = &H1I
-        Private Const A_HIDDEN As Integer = &H2I
-        Private Const A_SYSTEM As Integer = &H4I
-        Private Const A_VOLID As Integer = &H8I
-        Private Const A_SUBDIR As Integer = &H10I
-        Private Const A_ARCH As Integer = &H20I
-        Private Const A_ALLBITS As Integer = (A_NORMAL Or A_RDONLY Or A_HIDDEN Or A_SYSTEM Or A_VOLID Or A_SUBDIR Or A_ARCH)
-
         Friend Const sTimeFormat As String = "T"
         Friend Const sDateFormat As String = "d"
         Friend Const sDateTimeFormat As String = "F"
index 4a21a06..8a0d1b8 100644 (file)
@@ -8,6 +8,7 @@
     <DefineConstants>$(DefineConstants);REGISTRY_ASSEMBLY</DefineConstants>
     <IsPartialFacadeAssembly Condition="'$(TargetsNetFx)' == 'true'">true</IsPartialFacadeAssembly>
     <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(OSGroup)' == 'AnyOS' AND '$(TargetGroup)' == 'netstandard'">SR.PlatformNotSupported_Registry</GeneratePlatformNotSupportedAssemblyMessage>
+    <NoWarn Condition="'$(TargetsUnix)' == 'true'">$(NoWarn);CA1823</NoWarn> <!-- Avoid unused fields warnings in Unix build -->
     <!-- 
         Temporarily necessary as this is only being built for UWP due to an unwanted dependency on it 
         https://github.com/dotnet/corefx/issues/15966
index b102ab5..be117fd 100644 (file)
@@ -54,109 +54,6 @@ namespace Microsoft.CSharp
                                                          GeneratorSupport.GenericTypeDeclaration |
                                                          GeneratorSupport.DeclareIndexerProperties;
 
-        private static readonly string[][] s_keywords = new string[][] {
-            null,           // 1 character
-            new string[] {  // 2 characters
-                "as",
-                "do",
-                "if",
-                "in",
-                "is",
-            },
-            new string[] {  // 3 characters
-                "for",
-                "int",
-                "new",
-                "out",
-                "ref",
-                "try",
-            },
-            new string[] {  // 4 characters
-                "base",
-                "bool",
-                "byte",
-                "case",
-                "char",
-                "else",
-                "enum",
-                "goto",
-                "lock",
-                "long",
-                "null",
-                "this",
-                "true",
-                "uint",
-                "void",
-            },
-            new string[] {  // 5 characters
-                "break",
-                "catch",
-                "class",
-                "const",
-                "event",
-                "false",
-                "fixed",
-                "float",
-                "sbyte",
-                "short",
-                "throw",
-                "ulong",
-                "using",
-                "while",
-            },
-            new string[] {  // 6 characters
-                "double",
-                "extern",
-                "object",
-                "params",
-                "public",
-                "return",
-                "sealed",
-                "sizeof",
-                "static",
-                "string",
-                "struct",
-                "switch",
-                "typeof",
-                "unsafe",
-                "ushort",
-            },
-            new string[] {  // 7 characters
-                "checked",
-                "decimal",
-                "default",
-                "finally",
-                "foreach",
-                "private",
-                "virtual",
-            },
-            new string[] {  // 8 characters
-                "abstract",
-                "continue",
-                "delegate",
-                "explicit",
-                "implicit",
-                "internal",
-                "operator",
-                "override",
-                "readonly",
-                "volatile",
-            },
-            new string[] {  // 9 characters
-                "__arglist",
-                "__makeref",
-                "__reftype",
-                "interface",
-                "namespace",
-                "protected",
-                "unchecked",
-            },
-            new string[] {  // 10 characters
-                "__refvalue",
-                "stackalloc",
-            },
-        };
-
         internal CSharpCodeGenerator() { }
 
         internal CSharpCodeGenerator(IDictionary<string, string> providerOptions)
index c93e785..4c6c5e3 100644 (file)
@@ -30,8 +30,7 @@ namespace System.Collections
         private int _growFactor; // 100 == 1.0, 130 == 1.3, 200 == 2.0. Do not rename (binary serialization)
         private int _version; // Do not rename (binary serialization)
 
-        private const int _MinimumGrow = 4;
-        private const int _ShrinkThreshold = 32;
+        private const int MinimumGrow = 4;
 
         // Creates a queue with room for capacity objects. The default initial
         // capacity and grow factor are used.
@@ -161,9 +160,9 @@ namespace System.Collections
             if (_size == _array.Length)
             {
                 int newcapacity = (int)((long)_array.Length * (long)_growFactor / 100);
-                if (newcapacity < _array.Length + _MinimumGrow)
+                if (newcapacity < _array.Length + MinimumGrow)
                 {
-                    newcapacity = _array.Length + _MinimumGrow;
+                    newcapacity = _array.Length + MinimumGrow;
                 }
                 SetCapacity(newcapacity);
             }
index 3ead179..aaec350 100644 (file)
@@ -71,8 +71,6 @@ namespace System.Collections
         private KeyList keyList; // Do not rename (binary serialization)
         private ValueList valueList; // Do not rename (binary serialization)
 
-        private const int _defaultCapacity = 16;
-
         // Copy of Array.MaxArrayLength
         internal const int MaxArrayLength = 0X7FEFFFFF;
 
index 9f09988..deb6477 100644 (file)
@@ -708,7 +708,6 @@ namespace System.Collections
 
         // XPerY=n means that n Xs can be stored in 1 Y. 
         private const int BitsPerInt32 = 32;
-        private const int BytesPerInt32 = 4;
         private const int BitsPerByte = 8;
 
         private const int BitShiftPerInt32 = 5;
index 19fdf9f..f8028fb 100644 (file)
@@ -535,11 +535,6 @@ namespace System.Collections.Generic
             [AllowNull] private T _current;
             private int _index;
 
-            const string LinkedListName = "LinkedList";
-            const string CurrentValueName = "Current";
-            const string VersionName = "Version";
-            const string IndexName = "Index";
-
             internal Enumerator(LinkedList<T> list)
             {
                 _list = list;
index 5dea6aa..80b89a0 100644 (file)
@@ -62,19 +62,6 @@ namespace System.Collections.Generic
         private const string ItemsName = "Items"; // Do not rename (binary serialization)
         private const string VersionName = "Version"; // Do not rename (binary serialization)
 
-        // Needed for enumerator
-        private const string TreeName = "Tree";
-        private const string NodeValueName = "Item";
-        private const string EnumStartName = "EnumStarted";
-        private const string ReverseName = "Reverse";
-        private const string EnumVersionName = "EnumVersion";
-
-        // Needed for TreeSubset
-        private const string MinName = "Min";
-        private const string MaxName = "Max";
-        private const string LowerBoundActiveName = "lBoundActive";
-        private const string UpperBoundActiveName = "uBoundActive";
-
         internal const int StackAllocThreshold = 100;
 
         #endregion
@@ -1916,8 +1903,6 @@ namespace System.Collections.Generic
         [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")]
         public struct Enumerator : IEnumerator<T>, IEnumerator, ISerializable, IDeserializationCallback
         {
-            private static readonly Node s_dummyNode = new Node(default(T)!, NodeColor.Red);
-
             private SortedSet<T> _tree;
             private int _version;
 
index 50a70db..2555897 100644 (file)
@@ -22,7 +22,6 @@ namespace System.ComponentModel.Composition
     [DebuggerDisplay("{Message}")]
     public class CompositionException : Exception
     {
-        private const string ErrorsKey = "Errors";
         private ReadOnlyCollection<CompositionError> _errors;
 
         /// <summary>
index e5e1dd7..b6ce9be 100644 (file)
@@ -12,8 +12,6 @@ namespace System.ComponentModel.Composition.ReflectionModel
     {
         private class LifetimeContext
         {
-            private static Type[] types = { typeof(ComposablePartDefinition) };
-
             public Tuple<T, Action> GetExportLifetimeContextFromExport<T>(Export export)
             {
                 T exportedValue;
index ed430f4..ac4daf8 100644 (file)
@@ -14,7 +14,6 @@ namespace System.ComponentModel.Composition.ReflectionModel
         private static readonly Type LazyOfTType = typeof(Lazy<>);
         private static readonly Type LazyOfTMType = typeof(Lazy<,>);
         private static readonly Type ExportFactoryOfTType = typeof(ExportFactory<>);
-        private static readonly Type ExportFactoryOfTMType = typeof(ExportFactory<,>);
 
         private readonly Type _type;
         private readonly bool _isAssignableCollectionType;
index 7c9b959..e7e47f7 100644 (file)
@@ -44,7 +44,6 @@ namespace System.ComponentModel.Design
     internal class RuntimeLicenseContext : LicenseContext
     {
         private static TraceSwitch s_runtimeLicenseContextSwitch = new TraceSwitch("RuntimeLicenseContextTrace", "RuntimeLicenseContext tracing");
-        private const int ReadBlock = 400;
 
         internal Hashtable _savedLicenseKeys;
 
index 18e298f..6f19e9d 100644 (file)
@@ -14,8 +14,6 @@ namespace System.Composition.Convention
     /// </summary>
     public class ConventionBuilder : AttributedModelProvider
     {
-        private static readonly List<object> s_emptyList = new List<object>();
-
         private readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
         private readonly List<PartConventionBuilder> _conventions = new List<PartConventionBuilder>();
 
index 5dc0a72..71e6bce 100644 (file)
@@ -15,7 +15,6 @@ namespace System.Configuration
     {
         private NameValueCollection _map;
         private static Type s_stringType = typeof(string);
-        private static Type[] _paramsArray = new Type[] { s_stringType };
         private static string NullString = "None";
 
         public AppSettingsReader()
index 69f429a..156d3b9 100644 (file)
@@ -18,7 +18,6 @@ namespace System.Configuration
     public class ConfigurationErrorsException : ConfigurationException
     {
         // Constants
-        private const string HttpPrefix = "http:";
         private const string SerializationParamFilename = "firstFilename";
         private const string SerializationParamLine = "firstLine";
         private const string SerializationParamErrorCount = "count";
@@ -253,4 +252,4 @@ namespace System.Configuration
             return errorInfo?.Filename;
         }
     }
-}
\ No newline at end of file
+}
index e500c0f..846d21f 100644 (file)
@@ -11,8 +11,6 @@ namespace System.Configuration
 {
     public sealed class DpapiProtectedConfigurationProvider : ProtectedConfigurationProvider
     {
-        private const int CRYPTPROTECT_UI_FORBIDDEN = 0x1;
-        private const int CRYPTPROTECT_LOCAL_MACHINE = 0x4;
         private bool _useMachineProtection = true;
         private string _keyEntropy;
 
index 8e7d384..2fd5ca7 100644 (file)
@@ -23,7 +23,6 @@ namespace System.Configuration
             typeof(SettingValueElement),
             null,
             ConfigurationPropertyOptions.IsRequired);
-        private static readonly XmlDocument s_document = new XmlDocument();
         private static readonly ConfigurationPropertyCollection s_properties = new ConfigurationPropertyCollection() { s_propName, s_propSerializeAs, s_propValue };
 
         public SettingElement()
index 4da54ca..5fdd3a3 100644 (file)
@@ -144,7 +144,6 @@ namespace System.Data
         private readonly DataRowBuilder _rowBuilder;
         private const string KEY_XMLSCHEMA = "XmlSchema";
         private const string KEY_XMLDIFFGRAM = "XmlDiffGram";
-        private const string KEY_NAME = "TableName";
 
         internal readonly List<DataView> _delayedViews = new List<DataView>();
         private readonly List<DataViewListener> _dataViewListeners = new List<DataViewListener>();
index ee134b0..a135840 100644 (file)
@@ -41,11 +41,13 @@ namespace System.Data.Common
 
         private readonly KeyRestrictionBehavior _behavior;
 
-#pragma warning disable 169
+#pragma warning disable CS0169
+#pragma warning disable CA1823
         // this field is no longer used, hence the warning was disabled
         // however, it can not be removed or it will break serialization with V1.1
         private readonly string _encryptedActualConnectionString;
-#pragma warning restore 169
+#pragma warning restore CA1823
+#pragma warning restore CS0169
 
         internal DBConnectionString(string value, string restrictions, KeyRestrictionBehavior behavior, Dictionary<string, string> synonyms, bool useOdbcRules)
             : this(new DbConnectionOptions(value, synonyms, useOdbcRules), restrictions, behavior, synonyms, false)
index 5a7e3aa..92c0afb 100644 (file)
@@ -71,18 +71,14 @@ namespace System.Data.Common
 
         private static readonly Regex ConnectionStringRegex = new Regex(ConnectionStringPattern, RegexOptions.ExplicitCapture | RegexOptions.Compiled);
         private static readonly Regex ConnectionStringRegexOdbc = new Regex(ConnectionStringPatternOdbc, RegexOptions.ExplicitCapture | RegexOptions.Compiled);
+        private static readonly Regex ConnectionStringValidValueRegex = new Regex("^[^\u0000]*$", RegexOptions.Compiled); // value not allowed to contain embedded null
 #endif
-        private const string ConnectionStringValidKeyPattern = "^(?![;\\s])[^\\p{Cc}]+(?<!\\s)$"; // key not allowed to start with semi-colon or space or contain non-visible characters or end with space
-        private const string ConnectionStringValidValuePattern = "^[^\u0000]*$";                    // value not allowed to contain embedded null
-        private const string ConnectionStringQuoteValuePattern = "^[^\"'=;\\s\\p{Cc}]*$";           // generally do not quote the value if it matches the pattern
-        private const string ConnectionStringQuoteOdbcValuePattern = "^\\{([^\\}\u0000]|\\}\\})*\\}$"; // do not quote odbc value if it matches this pattern
+        private static readonly Regex ConnectionStringValidKeyRegex = new Regex("^(?![;\\s])[^\\p{Cc}]+(?<!\\s)$", RegexOptions.Compiled);// key not allowed to start with semi-colon or space or contain non-visible characters or end with space
+      
         internal const string DataDirectory = "|datadirectory|";
 
-        private static readonly Regex ConnectionStringValidKeyRegex = new Regex(ConnectionStringValidKeyPattern, RegexOptions.Compiled);
-        private static readonly Regex ConnectionStringValidValueRegex = new Regex(ConnectionStringValidValuePattern, RegexOptions.Compiled);
-
-        private static readonly Regex ConnectionStringQuoteValueRegex = new Regex(ConnectionStringQuoteValuePattern, RegexOptions.Compiled);
-        private static readonly Regex ConnectionStringQuoteOdbcValueRegex = new Regex(ConnectionStringQuoteOdbcValuePattern, RegexOptions.ExplicitCapture | RegexOptions.Compiled);
+        private static readonly Regex ConnectionStringQuoteValueRegex = new Regex("^[^\"'=;\\s\\p{Cc}]*$", RegexOptions.Compiled); // generally do not quote the value if it matches the pattern
+        private static readonly Regex ConnectionStringQuoteOdbcValueRegex = new Regex("^\\{([^\\}\u0000]|\\}\\})*\\}$", RegexOptions.ExplicitCapture | RegexOptions.Compiled); // do not quote odbc value if it matches this pattern
 
         // connection string common keywords
         private static class KEY
index 38ccd6d..02042da 100644 (file)
@@ -20,13 +20,9 @@ namespace System.Data.ProviderBase
     {
         private const int E_NotImpersonationToken = unchecked((int)0x8007051D);
         private const int Win32_CheckTokenMembership = 1;
-        private const int Win32_GetTokenInformation_1 = 2;
-        private const int Win32_GetTokenInformation_2 = 3;
-        private const int Win32_ConvertSidToStringSidW = 4;
         private const int Win32_CreateWellKnownSid = 5;
 
         static public readonly DbConnectionPoolIdentity NoIdentity = new DbConnectionPoolIdentity(String.Empty, false, true);
-        static private readonly byte[] NetworkSid = (ADP.IsWindowsNT ? CreateWellKnownSid(WellKnownSidType.NetworkSid) : null);
 
         private readonly string _sidString;
         private readonly bool _isRestricted;
index decb479..d209359 100644 (file)
@@ -23,7 +23,6 @@ namespace System.Data.ProviderBase
         private const string _minimumVersion = "MinimumVersion";
         private const string _dataSourceProductVersionNormalized = "DataSourceProductVersionNormalized";
         private const string _dataSourceProductVersion = "DataSourceProductVersion";
-        private const string _restrictionDefault = "RestrictionDefault";
         private const string _restrictionNumber = "RestrictionNumber";
         private const string _numberOfRestrictions = "NumberOfRestrictions";
         private const string _restrictionName = "RestrictionName";
index 381d3ec..746ff6c 100644 (file)
@@ -18,7 +18,6 @@ namespace System.Data.SqlClient.SNI
     internal sealed class SNINpHandle : SNIHandle
     {
         internal const string DefaultPipePath = @"sql\query"; // e.g. \\HOSTNAME\pipe\sql\query
-        private const int MAX_PIPE_INSTANCES = 255;
 
         private readonly string _targetServer;
         private readonly object _callbackObject;
index e99cb24..42e82ba 100644 (file)
@@ -505,7 +505,6 @@ namespace System.Data.SqlClient.SNI
 
     internal class DataSource
     {
-        private const char CommaSeparator = ',';
         private const char BackSlashSeparator = '\\';
         private const string DefaultHostName = "localhost";
         private const string DefaultSqlServerInstanceName = "mssqlserver";
index 55f9c64..774b2a5 100644 (file)
@@ -14,9 +14,6 @@ namespace System.Data.SqlClient
 {
     sealed internal class SqlConnectionFactory : DbConnectionFactory
     {
-
-        private const string _metaDataXml = "MetaDataXml";
-
         private SqlConnectionFactory() : base() { }
 
         public static readonly SqlConnectionFactory SingletonInstance = new SqlConnectionFactory();
index d28c1d4..a3095a4 100644 (file)
@@ -222,9 +222,6 @@ namespace System.Data.SqlClient
         private static Dictionary<string, Dictionary<IdentityUserNamePair, List<DatabaseServicePair>>> s_serverUserHash =
                    new Dictionary<string, Dictionary<IdentityUserNamePair, List<DatabaseServicePair>>>(StringComparer.OrdinalIgnoreCase);
         private static SqlDependencyProcessDispatcher s_processDispatcher = null;
-        // The following two strings are used for AppDomain.CreateInstance.
-        private static readonly string s_assemblyName = (typeof(SqlDependencyProcessDispatcher)).Assembly.FullName;
-        private static readonly string s_typeName = (typeof(SqlDependencyProcessDispatcher)).FullName;
 
         // Constructors
 
@@ -972,4 +969,4 @@ namespace System.Data.SqlClient
             }
         }
     }
-}
\ No newline at end of file
+}
index b7346c0..107c340 100644 (file)
@@ -13,12 +13,9 @@ namespace System.Data.SqlClient
 {
     internal sealed class SqlMetaDataFactory : DbMetaDataFactory
     {
-
         private const string _serverVersionNormalized90 = "09.00.0000";
-        private const string _serverVersionNormalized90782 = "09.00.0782";
         private const string _serverVersionNormalized10 = "10.00.0000";
 
-
         public SqlMetaDataFactory(Stream XMLStream,
                                     string serverVersion,
                                     string serverVersionNormalized) :
index 6fec58a..138ea2d 100644 (file)
@@ -9,6 +9,7 @@ namespace System.Data.SqlClient
 {
     internal sealed partial class TdsParser
     {
+        private static readonly object s_tdsParserLock = new object();
         private static volatile bool s_fSSPILoaded = false; // bool to indicate whether library has been loaded
 
         internal void PostReadAsyncForMars()
index 37f27d8..000f4ef 100644 (file)
@@ -121,9 +121,6 @@ namespace System.Data.SqlClient
         // textptr sequence
         private static readonly byte[] s_longDataHeader = { 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 
-        private static object s_tdsParserLock = new object();
-
-
         // XML metadata substitute sequence
         private static readonly byte[] s_xmlMetadataSubstituteSequence = { 0xe7, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
index fb57c55..2ab97f0 100644 (file)
@@ -8,14 +8,11 @@ namespace System.Data.SqlClient
 {
     internal sealed class TdsParserStateObjectFactory
     {
-
-        private const string UseLegacyNetworkingOnWindows = "System.Data.SqlClient.UseLegacyNetworkingOnWindows";
-
         public static readonly TdsParserStateObjectFactory Singleton = new TdsParserStateObjectFactory();
 
-
         // Temporary disabling App Context switching for managed SNI.
         // If the appcontext switch is set then Use Managed SNI based on the value. Otherwise Managed SNI should always be used.
+        //private const string UseLegacyNetworkingOnWindows = "System.Data.SqlClient.UseLegacyNetworkingOnWindows";
         //private static bool shouldUseLegacyNetorking;
         //public static bool UseManagedSNI { get; } = AppContext.TryGetSwitch(UseLegacyNetworkingOnWindows, out shouldUseLegacyNetorking) ? !shouldUseLegacyNetorking : true;
 
index f9ecdc0..f3ff5a6 100644 (file)
@@ -42,7 +42,9 @@ namespace System.Diagnostics
         private static TimeSync timeSync = new TimeSync();
 
         // sync DateTime and Stopwatch ticks every 2 hours
-        private static Timer syncTimeUpdater = InitalizeSyncTimer();
+#pragma warning disable CA1823 // suppress unused field warning, as it's used to keep the timer alive
+        private static readonly Timer syncTimeUpdater = InitalizeSyncTimer();
+#pragma warning restore CA1823
 
         [System.Security.SecuritySafeCritical]
         private static Timer InitalizeSyncTimer()
index 3a14266..509fbba 100644 (file)
@@ -26,8 +26,6 @@ namespace System.Diagnostics
         internal const string DllName = "EventLogMessages.dll";
         private const string eventLogMutexName = "netfxeventlog.1.0";
         private const int DefaultMaxSize = 512 * 1024;
-        private const int DefaultRetention = 7 * SecondsPerDay;
-        private const int SecondsPerDay = 60 * 60 * 24;
 
         private EventLogInternal _underlyingEventLog;
 
index 538b633..8439f50 100644 (file)
@@ -474,6 +474,5 @@ namespace System.Diagnostics
         }
 
         private static readonly DateTime beginningOfTime = new DateTime(1970, 1, 1, 0, 0, 0);
-        private const int OFFSETFIXUP = 4 + 4 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2 + 4 + 4 + 4 + 4 + 4 + 4;
     }
 }
index 47acfb7..bb6c2e4 100644 (file)
@@ -57,8 +57,6 @@ namespace System.Diagnostics
         internal const string DllName = "EventLogMessages.dll";
         private const string eventLogMutexName = "netfxeventlog.1.0";
         private const int SecondsPerDay = 60 * 60 * 24;
-        private const int DefaultMaxSize = 512 * 1024;
-        private const int DefaultRetention = 7 * SecondsPerDay;
 
         private const int Flag_notifying = 0x1;           // keeps track of whether we're notifying our listeners - to prevent double notifications
         private const int Flag_forwards = 0x2;     // whether the cache contains entries in forwards order (true) or backwards (false)
index 60a22d0..fd2d23e 100644 (file)
@@ -25,7 +25,6 @@ namespace System.Diagnostics
     {
         internal const string PerfShimName = "netfxperf.dll";
         private const string PerfShimFullNameSuffix = @"\netfxperf.dll";
-        private const string PerfShimPathExp = @"%systemroot%\system32\netfxperf.dll";
         internal const string OpenEntryPoint = "OpenPerformanceData";
         internal const string CollectEntryPoint = "CollectPerformanceData";
         internal const string CloseEntryPoint = "ClosePerformanceData";
index b012cb2..ad7bf2b 100644 (file)
@@ -5,7 +5,6 @@
 using Microsoft.Win32.SafeHandles;
 using System.Collections.Generic;
 using System.ComponentModel;
-using System.Globalization;
 using System.IO;
 using System.Runtime.InteropServices;
 using System.Security;
@@ -16,6 +15,8 @@ namespace System.Diagnostics
 {
     public partial class Process : IDisposable
     {
+        private static readonly object s_createProcessLock = new object();
+
         /// <summary>
         /// Creates an array of <see cref="Process"/> components that are associated with process resources on a
         /// remote computer. These process resources share the specified process name.
@@ -466,6 +467,7 @@ namespace System.Diagnostics
             Interop.Kernel32.SECURITY_ATTRIBUTES unused_SecAttrs = new Interop.Kernel32.SECURITY_ATTRIBUTES();
             SafeProcessHandle procSH = new SafeProcessHandle();
             SafeThreadHandle threadSH = new SafeThreadHandle();
+            
             // handles used in parent process
             SafeFileHandle parentInputPipeHandle = null;
             SafeFileHandle childInputPipeHandle = null;
@@ -473,6 +475,7 @@ namespace System.Diagnostics
             SafeFileHandle childOutputPipeHandle = null;
             SafeFileHandle parentErrorPipeHandle = null;
             SafeFileHandle childErrorPipeHandle = null;
+
             lock (s_createProcessLock)
             {
                 try
index fa5c365..9a39f48 100644 (file)
@@ -65,8 +65,6 @@ namespace System.Diagnostics
         private StreamReader _standardError;
         private bool _disposed;
 
-        private static object s_createProcessLock = new object();
-
         private bool _standardInputAccessed;
 
         private StreamReadMode _outputStreamReadMode;
index 1ab15f4..04dec45 100644 (file)
@@ -33,7 +33,6 @@ namespace System.DirectoryServices.ActiveDirectory
         internal const int DS_REPSYNC_ALL_SOURCES = 0x00000010;
         internal const int DS_REPSYNCALL_ID_SERVERS_BY_DN = 0x00000004;
         internal const int DS_REPL_NOTSUPPORTED = 50;
-        private const int DS_REPL_INFO_FLAG_IMPROVE_LINKED_ATTRS = 0x00000001;
         private ReplicationConnectionCollection _inbound = null;
         private ReplicationConnectionCollection _outbound = null;
 
index 571d0f5..06d9d89 100644 (file)
@@ -28,8 +28,6 @@ namespace System.DirectoryServices.ActiveDirectory
         // Private Variables
         private readonly DirectoryContext _context = null;
         private readonly DirectoryEntryManager _directoryEntryMgr = null;
-        private readonly IntPtr _dsHandle = IntPtr.Zero;
-        private readonly IntPtr _authIdentity = IntPtr.Zero;
         private bool _disposed = false;
 
         // Internal variables corresponding to public properties
index e5cfb5f..f38eabf 100644 (file)
@@ -12,6 +12,7 @@ namespace System.Drawing
 {
     public sealed partial class BufferedGraphicsContext : IDisposable
     {
+        private Size _bufferSize = Size.Empty;
         private Size _virtualSize;
         private Point _targetLoc;
         private IntPtr _compatDC;
index 750f3a3..ec8deab 100644 (file)
@@ -13,7 +13,6 @@ namespace System.Drawing
     public sealed partial class BufferedGraphicsContext : IDisposable
     {
         private Size _maximumBuffer;
-        private Size _bufferSize = Size.Empty;
 
         /// <summary>
         /// Basic constructor.
index 070fa24..95d0cce 100644 (file)
@@ -16,18 +16,16 @@ namespace System.Drawing.Imaging
     {
         // Format IDs
         // private static ImageFormat undefined = new ImageFormat(new Guid("{b96b3ca9-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_memoryBMP = new ImageFormat(new Guid("{b96b3caa-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_bmp = new ImageFormat(new Guid("{b96b3cab-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_emf = new ImageFormat(new Guid("{b96b3cac-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_wmf = new ImageFormat(new Guid("{b96b3cad-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_jpeg = new ImageFormat(new Guid("{b96b3cae-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_png = new ImageFormat(new Guid("{b96b3caf-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_gif = new ImageFormat(new Guid("{b96b3cb0-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_tiff = new ImageFormat(new Guid("{b96b3cb1-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_exif = new ImageFormat(new Guid("{b96b3cb2-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_photoCD = new ImageFormat(new Guid("{b96b3cb3-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_flashPIX = new ImageFormat(new Guid("{b96b3cb4-0728-11d3-9d7b-0000f81ef32e}"));
-        private static ImageFormat s_icon = new ImageFormat(new Guid("{b96b3cb5-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_memoryBMP = new ImageFormat(new Guid("{b96b3caa-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_bmp = new ImageFormat(new Guid("{b96b3cab-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_emf = new ImageFormat(new Guid("{b96b3cac-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_wmf = new ImageFormat(new Guid("{b96b3cad-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_jpeg = new ImageFormat(new Guid("{b96b3cae-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_png = new ImageFormat(new Guid("{b96b3caf-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_gif = new ImageFormat(new Guid("{b96b3cb0-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_tiff = new ImageFormat(new Guid("{b96b3cb1-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_exif = new ImageFormat(new Guid("{b96b3cb2-0728-11d3-9d7b-0000f81ef32e}"));
+        private static readonly ImageFormat s_icon = new ImageFormat(new Guid("{b96b3cb5-0728-11d3-9d7b-0000f81ef32e}"));
 
         private Guid _guid;
 
index f9170ba..885267b 100644 (file)
@@ -14,7 +14,6 @@ namespace System.Windows.Forms
     /// </summary>
     internal static class DpiHelper
     {
-        private const string EnableHighDpiConfigurationValueName = "EnableWindowsFormsHighDpiAutoResizing";
         private const double LogicalDpi = 96.0;
         private static bool s_isInitialized = false;
         /// <summary>
index 1d09117..07dabca 100644 (file)
@@ -13,8 +13,6 @@ namespace System.IO.Compression
     [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")]
     public partial class ZipArchiveEntry
     {
-        private const ushort DefaultVersionToExtract = 10;
-
         // The maximum index of our buffers, from the maximum index of a byte array
         private const int MaxSingleBufferSize = 0x7FFFFFC7;
 
index b794dcd..1139813 100644 (file)
@@ -52,9 +52,6 @@ namespace System.IO
         private RenamedEventHandler _onRenamedHandler = null;
         private ErrorEventHandler _onErrorHandler = null;
 
-        // To validate the input for "path"
-        private static readonly char[] s_wildcards = new char[] { '?', '*' };
-
         private const int c_notifyFiltersValidMask = (int)(NotifyFilters.Attributes |
                                                            NotifyFilters.CreationTime |
                                                            NotifyFilters.DirectoryName |
index 581a34e..04ac3f3 100644 (file)
@@ -13,6 +13,12 @@ namespace System.IO.Packaging
     /// </summary>
     public static partial class PackUriHelper
     {
+        // We need to perform Escaping for the following - '%'; '@'; ',' and '?' 
+        // !!Important!! - The order is important - The '%' sign should be escaped first.
+        // If any more characters need to be added to the array below they should be added at the end.
+        // All of these arrays must maintain the same ordering.
+        private static readonly char[] s_specialCharacterChars = { '%', '@', ',', '?' };
+
         #region Public Methods
 
         /// <summary>
index ca788a4..92daa59 100644 (file)
@@ -382,12 +382,6 @@ namespace System.IO.Packaging
         #endregion Internal Methods
 
         #region Private Methods
-
-        private static readonly char[] HexUpperChars = {
-            '0', '1', '2', '3', '4', '5', '6', '7',
-            '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
-        };
-
         private static Exception GetExceptionIfPartUriInvalid(Uri partUri, out string partUriString)
         {
             partUriString = string.Empty;
@@ -588,12 +582,6 @@ namespace System.IO.Packaging
         //we use this dummy Uri to represent the root of the container.
         private static readonly Uri s_packageRootUri = new Uri("/", UriKind.Relative);
 
-        // We need to perform Escaping for the following - '%'; '@'; ',' and '?' 
-        // !!Important!! - The order is important - The '%' sign should be escaped first.
-        // If any more characters need to be added to the array below they should be added at the end.
-        // All of these arrays must maintain the same ordering.
-        private static readonly char[] s_specialCharacterChars = { '%', '@', ',', '?' };
-
         //Rels segment and extension
         private const string RelationshipPartSegmentName = "_rels";
         private const string RelationshipPartExtensionName = ".rels";
index d9a2d3e..848bc9d 100644 (file)
@@ -488,7 +488,6 @@ namespace System.IO.Packaging
         #region Private Members
 
         private const int InitialPartListSize = 50;
-        private const int InitialPieceNameListSize = 50;
 
         private ZipArchive _zipArchive;
         private Stream _containerStream;      // stream we are opened in if Open(Stream) was called
index 7fbf155..e432148 100644 (file)
@@ -35,8 +35,6 @@ namespace System.IO.Ports
         private const int MinDataBits = 5;
         private const string DefaultNewLine = "\n";
 
-        private const string SERIAL_NAME = @"\Device\Serial";
-
         // --------- members supporting exposed properties ------------*
         private int _baudRate = DefaultBaudRate;
         private int _dataBits = DefaultDataBits;
index 75ecfb4..73d1d09 100644 (file)
@@ -27,7 +27,6 @@ namespace System.Management
         // the correct path and succeed in loading the DLL. Once the DllImport occurs, the DLL will
         // already be in the cache.
         // 
-        const string SerializationBlobName = "flatWbemClassObject";
         static readonly string name = typeof(IWbemClassObjectFreeThreaded).FullName;
         public static Guid IID_IWbemClassObject = new Guid("DC12A681-737F-11CF-884D-00AA004B2E24");
 
@@ -424,7 +423,6 @@ namespace System.Management
 
     sealed class IWbemQualifierSetFreeThreaded : IDisposable
     {
-        const string SerializationBlobName = "flatWbemClassObject";
         static readonly string name = typeof(IWbemQualifierSetFreeThreaded).FullName;
         public static Guid IID_IWbemClassObject = new Guid("DC12A681-737F-11CF-884D-00AA004B2E24");
 
index 229da03..dfdcf30 100644 (file)
@@ -183,9 +183,11 @@ namespace System.Management
         // prevent Fastprox.dll from unloading prematurely.
         // Since this is fixed in WinXP, we only hold onto a WbemContext if we are NOT running XP or later.
 
-#pragma warning disable 0414 // Kept for possible reflection, comment above for history
-        private static WbemContext lockOnFastProx = null; // RemovedDuringPort System.Management.Instrumentation.WMICapabilities.IsWindowsXPOrHigher()?null:new WbemContext();
-#pragma warning restore 0414
+#pragma warning disable CA1823
+#pragma warning disable CS0169 // Kept for possible reflection, comment above for history
+        private static WbemContext lockOnFastProx; // RemovedDuringPort System.Management.Instrumentation.WMICapabilities.IsWindowsXPOrHigher()?null:new WbemContext();
+#pragma warning restore CS0169
+#pragma warning restore CA1823
 
         //
         // The wbemObject is changed from a field to a property. This is to avoid major code churn and simplify the solution to
index 3caf42a..a9cd0c5 100644 (file)
@@ -102,33 +102,7 @@ namespace System.Management
         private SortedList PublicNamesUsed    = new SortedList(StringComparer.OrdinalIgnoreCase);
         private SortedList PrivateNamesUsed = new SortedList(StringComparer.OrdinalIgnoreCase);
         
-        private ArrayList CommentsString = new ArrayList(5);
         private bool        bHasEmbeddedProperties = false;
-
-        const int IDS_CommentShouldSerialize        = 0;
-        const int IDS_CommentIsPropNull            = 1;
-        const int IDS_CommentResetProperty                = 2;
-        const int IDS_CommentAttributeProperty            = 3;
-        const int IDS_CommentDateConversionFunction            = 4;
-        const int IDS_CommentGetInstances            = 5;
-        const int IDS_CommentClassBegin            = 6;
-        const int IDS_COMMENT_PRIV_AUTOCOMMIT        = 7;
-        const int IDS_CommentConstructors            = 8;
-        const int IDS_COMMENT_ORIG_NAMESPACE        = 9;
-        const int IDS_COMMENT_CLASSNAME                = 10;
-        const int IDS_CommentSystemObject                = 11;
-        const int IDS_CommentLateBoundObject            = 12;
-        const int IDS_CommentManagementScope                = 13;
-        const int IDS_CommentAutoCommitProperty        = 14;
-        const int IDS_CommentManagementPath                = 15;
-        const int IDS_COMMENT_PROP_TYPECONVERTER    = 16;
-        const int IDS_CommentSystemPropertiesClass            = 17;
-        const int IDS_CommentEnumeratorImplementation                = 18;
-        const int IDS_CommentLateBoundProperty            = 19;
-        const int IDS_COMMENTS_CREATEDCLASS            = 20;
-        const int IDS_CommentEmbeddedObject            = 21;
-        const int IDS_CommentCurrentObject            = 22;
-        const int IDS_CommentFlagForEmbedded        = 23;
         
 
         /// <summary>
@@ -5230,79 +5204,105 @@ namespace System.Management
             }
             return retFunctionName;
         }
+
         /*
-            /// <summary>
-            /// Function to initialize the comments to be put in the generated code
-            /// Later can be moved to Resource once resource for System.management.dll is setup
-            /// </summary>
-            private void InitializeComments()
-            {
-                string strComment = "Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if"; 
-            
-                strComment = strComment  + " a particular property has to be serialized. These functions are added for all ValueType";
-                strComment = strComment  + " properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions";
-                strComment = strComment  + " uses Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation";
-                strComment = strComment  + " for the properties to check for NULL value of property so that a empty value can be shown";
-                strComment = strComment  + " in Property browser in case of Drag and Drop in Visual studio.";
+        const int IDS_CommentShouldSerialize        = 0;
+        const int IDS_CommentIsPropNull            = 1;
+        const int IDS_CommentResetProperty                = 2;
+        const int IDS_CommentAttributeProperty            = 3;
+        const int IDS_CommentDateConversionFunction            = 4;
+        const int IDS_CommentGetInstances            = 5;
+        const int IDS_CommentClassBegin            = 6;
+        const int IDS_COMMENT_PRIV_AUTOCOMMIT        = 7;
+        const int IDS_CommentConstructors            = 8;
+        const int IDS_COMMENT_ORIG_NAMESPACE        = 9;
+        const int IDS_COMMENT_CLASSNAME                = 10;
+        const int IDS_CommentSystemObject                = 11;
+        const int IDS_CommentLateBoundObject            = 12;
+        const int IDS_CommentManagementScope                = 13;
+        const int IDS_CommentAutoCommitProperty        = 14;
+        const int IDS_CommentManagementPath                = 15;
+        const int IDS_COMMENT_PROP_TYPECONVERTER    = 16;
+        const int IDS_CommentSystemPropertiesClass            = 17;
+        const int IDS_CommentEnumeratorImplementation                = 18;
+        const int IDS_CommentLateBoundProperty            = 19;
+        const int IDS_COMMENTS_CREATEDCLASS            = 20;
+        const int IDS_CommentEmbeddedObject            = 21;
+        const int IDS_CommentCurrentObject            = 22;
+        const int IDS_CommentFlagForEmbedded        = 23;
 
-                CommentsString.Add(strComment);    // IDS_CommentShouldSerialize
+        /// <summary>
+        /// Function to initialize the comments to be put in the generated code
+        /// Later can be moved to Resource once resource for System.management.dll is setup
+        /// </summary>
+        private void InitializeComments()
+        {
+            string strComment = "Functions ShouldSerialize<PropertyName> are functions used by VS property browser to check if"; 
+            
+            strComment = strComment  + " a particular property has to be serialized. These functions are added for all ValueType";
+            strComment = strComment  + " properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions";
+            strComment = strComment  + " uses Is<PropertyName>Null function. These functions are also used in the TypeConverter implementation";
+            strComment = strComment  + " for the properties to check for NULL value of property so that a empty value can be shown";
+            strComment = strComment  + " in Property browser in case of Drag and Drop in Visual studio.";
 
-                strComment = "Functions Is<PropertyName>Null() are functions . These functions are to be used to check if a property is NULL.";
-                CommentsString.Add(strComment);    // IDS_CommentIsPropNull
+            CommentsString.Add(strComment);    // IDS_CommentShouldSerialize
 
-                strComment = "Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used in VS designere in"; 
-                strComment = strComment + " property browser to set a property to NULL.";
-                CommentsString.Add(strComment);    // IDS_CommentResetProperty
+            strComment = "Functions Is<PropertyName>Null() are functions . These functions are to be used to check if a property is NULL.";
+            CommentsString.Add(strComment);    // IDS_CommentIsPropNull
 
-                strComment = "Every property added to the class for WMI property has attributes set to define its behaviour in Visual Studio";
-                strComment = strComment + " designer and as well as to define a TypeConverter to be used.";
-                CommentsString.Add(strComment);    // IDS_CommentAttributeProperty
+            strComment = "Functions Reset<PropertyName> are added for Nullable Read/Write properties. These functions are used in VS designere in"; 
+            strComment = strComment + " property browser to set a property to NULL.";
+            CommentsString.Add(strComment);    // IDS_CommentResetProperty
 
-                strComment = "DateTime Conversions are added for the class to convert DMTF date to System.DateTime and Vise-versa. Conversion from DMTF";
-                strComment = strComment + " to System.DateTime conversion ignores the microseconds as System.DateTime doesn't have the microseconds part in it.";
-                CommentsString.Add(strComment);    // IDS_CommentDateConversionFunction
+            strComment = "Every property added to the class for WMI property has attributes set to define its behaviour in Visual Studio";
+            strComment = strComment + " designer and as well as to define a TypeConverter to be used.";
+            CommentsString.Add(strComment);    // IDS_CommentAttributeProperty
 
-                strComment = "Different flavours of GetInstances() help in enumerating instances of the WMI class.";
-                CommentsString.Add(strComment);    // IDS_CommentGetInstances
+            strComment = "DateTime Conversions are added for the class to convert DMTF date to System.DateTime and Vise-versa. Conversion from DMTF";
+            strComment = strComment + " to System.DateTime conversion ignores the microseconds as System.DateTime doesn't have the microseconds part in it.";
+            CommentsString.Add(strComment);    // IDS_CommentDateConversionFunction
 
-                strComment = "An Early Bound class generated for the WMI class "; 
-                CommentsString.Add(strComment);    // IDS_CommentClassBegin
+            strComment = "Different flavours of GetInstances() help in enumerating instances of the WMI class.";
+            CommentsString.Add(strComment);    // IDS_CommentGetInstances
 
-                CommentsString.Add("Member variable to store the autocommit behaviour for the class"); // IDS_COMMENT_PRIV_AUTOCOMMIT
+            strComment = "An Early Bound class generated for the WMI class "; 
+            CommentsString.Add(strComment);    // IDS_CommentClassBegin
 
-                CommentsString.Add("Below are different flavours of constructors to initialize the instance with a WMI object"); // IDS_CommentConstructors
+            CommentsString.Add("Member variable to store the autocommit behaviour for the class"); // IDS_COMMENT_PRIV_AUTOCOMMIT
 
-                CommentsString.Add("Property returns the namespace of the WMI class"); // IDS_COMMENT_ORIG_NAMESPACE
+            CommentsString.Add("Below are different flavours of constructors to initialize the instance with a WMI object"); // IDS_CommentConstructors
 
-                CommentsString.Add("Name of the WMI class");    // IDS_COMMENT_CLASSNAME;
+            CommentsString.Add("Property returns the namespace of the WMI class"); // IDS_COMMENT_ORIG_NAMESPACE
 
-                CommentsString.Add("Property pointing to a embeded object to get System properties of the WMI object"); // IDS_CommentSystemObject
+            CommentsString.Add("Name of the WMI class");    // IDS_COMMENT_CLASSNAME;
 
-                CommentsString.Add("Underlying lateBound WMI object"); // IDS_CommentLateBoundObject
+            CommentsString.Add("Property pointing to a embeded object to get System properties of the WMI object"); // IDS_CommentSystemObject
 
-                CommentsString.Add(" ManagementScope of the object"); //  IDS_CommentManagementScope
+            CommentsString.Add("Underlying lateBound WMI object"); // IDS_CommentLateBoundObject
 
-                strComment = "Property to show the autocommit behaviour for the WMI object. If this is";
-                strComment = strComment + "true then WMI object is saved to WMI then for change in every";
-                strComment = strComment + "property (ie Put is called after modification of a property) ";
-                CommentsString.Add(strComment); // IDS_CommentAutoCommitProperty
+            CommentsString.Add(" ManagementScope of the object"); //  IDS_CommentManagementScope
 
-                CommentsString.Add("The ManagementPath of the underlying WMI object"); // IDS_CommentManagementPath
+            strComment = "Property to show the autocommit behaviour for the WMI object. If this is";
+            strComment = strComment + "true then WMI object is saved to WMI then for change in every";
+            strComment = strComment + "property (ie Put is called after modification of a property) ";
+            CommentsString.Add(strComment); // IDS_CommentAutoCommitProperty
 
-                CommentsString.Add("TypeConverter to handle null values for ValueType properties"); // IDS_COMMENT_PROP_TYPECONVERTER
+            CommentsString.Add("The ManagementPath of the underlying WMI object"); // IDS_CommentManagementPath
 
-                CommentsString.Add(" Embedded class to represent WMI system Properties"); // IDS_CommentSystemPropertiesClass
+            CommentsString.Add("TypeConverter to handle null values for ValueType properties"); // IDS_COMMENT_PROP_TYPECONVERTER
 
-                CommentsString.Add("Enumerator implementation for enumerating instances of the class"); // IDS_CommentEnumeratorImplementation
-                CommentsString.Add("Property returning the underlying lateBound object"); // IDS_CommentLateBoundProperty
+            CommentsString.Add(" Embedded class to represent WMI system Properties"); // IDS_CommentSystemPropertiesClass
 
-                CommentsString.Add("Private property to hold the name of WMI class which created this class"); // IDS_COMMENTS_CREATEDCLASS
-                CommentsString.Add("Private variable to hold the embedded property representing the instance"); // IDS_CommentEmbeddedObject
-                CommentsString.Add("The current WMI object used"); //IDS_CommentCurrentObject
-                CommentsString.Add("Flag to indicate if an instance is an embedded object"); // IDS_CommentFlagForEmbedded
+            CommentsString.Add("Enumerator implementation for enumerating instances of the class"); // IDS_CommentEnumeratorImplementation
+            CommentsString.Add("Property returning the underlying lateBound object"); // IDS_CommentLateBoundProperty
 
-            }
+            CommentsString.Add("Private property to hold the name of WMI class which created this class"); // IDS_COMMENTS_CREATEDCLASS
+            CommentsString.Add("Private variable to hold the embedded property representing the instance"); // IDS_CommentEmbeddedObject
+            CommentsString.Add("The current WMI object used"); //IDS_CommentCurrentObject
+            CommentsString.Add("Flag to indicate if an instance is an embedded object"); // IDS_CommentFlagForEmbedded
+        }
         */
+
         /// <summary>
         /// Adds comments at the begining of the class defination
         /// </summary>
index caeb66c..c2799cc 100644 (file)
@@ -90,9 +90,6 @@ namespace System.Net.Http
     {
         #region Constants
 
-        private const char SpaceChar = ' ';
-        private const int StatusCodeLength = 3;
-
         private const string UriSchemeHttp = "http";
         private const string UriSchemeHttps = "https";
         private const string EncodingNameGzip = "gzip";
@@ -102,8 +99,6 @@ namespace System.Net.Http
         private const string NoTransferEncoding = HttpKnownHeaderNames.TransferEncoding + ":";
         private const string NoContentType = HttpKnownHeaderNames.ContentType + ":";
         private const string NoExpect = HttpKnownHeaderNames.Expect + ":";
-        private const int CurlAge = 5;
-        private const int MinCurlAge = 3;
 
         #endregion
 
@@ -116,10 +111,6 @@ namespace System.Net.Http
             new KeyValuePair<string,CURLAUTH>("Basic", CURLAUTH.Basic),
         };
 
-        // Max timeout value used by WinHttp handler, so mapping to that here.
-        private static readonly TimeSpan s_maxTimeout = TimeSpan.FromMilliseconds(int.MaxValue);
-
-        private static readonly char[] s_newLineCharArray = new char[] { HttpRuleParser.CR, HttpRuleParser.LF };
         private static readonly bool s_supportsAutomaticDecompression;
         private static readonly bool s_supportsSSL;
         private static readonly bool s_supportsHttp2Multiplexing;
@@ -141,7 +132,6 @@ namespace System.Net.Http
         private bool _useDefaultCredentials = HttpHandlerDefaults.DefaultUseDefaultCredentials;
         private CookieContainer _cookieContainer = new CookieContainer();
         private bool _useCookies = HttpHandlerDefaults.DefaultUseCookies;
-        private TimeSpan _connectTimeout = Timeout.InfiniteTimeSpan;
         private bool _automaticRedirection = HttpHandlerDefaults.DefaultAutomaticRedirection;
         private int _maxAutomaticRedirections = HttpHandlerDefaults.DefaultMaxAutomaticRedirections;
         private int _maxConnectionsPerServer = HttpHandlerDefaults.DefaultMaxConnectionsPerServer;
index 6683284..91fea8c 100644 (file)
@@ -6,6 +6,11 @@ namespace System.Net.Http
 {
     internal sealed partial class HttpEnvironmentProxy : IWebProxy
     {
+        private const string EnvAllProxyLC = "all_proxy";
+        private const string EnvHttpProxyLC = "http_proxy";
+        private const string EnvHttpsProxyLC = "https_proxy";
+        private const string EnvNoProxyLC = "no_proxy";
+
         public static bool TryCreate(out IWebProxy proxy)
         {
             // Get environment variables. Protocol specific take precedence over
index c080686..336abc0 100644 (file)
@@ -91,12 +91,8 @@ namespace System.Net.Http
     internal sealed partial class HttpEnvironmentProxy : IWebProxy
     {
         private const string EnvAllProxyUC = "ALL_PROXY";
-        private const string EnvAllProxyLC = "all_proxy";
-        private const string EnvHttpProxyLC = "http_proxy";
         private const string EnvHttpProxyUC = "HTTP_PROXY";
-        private const string EnvHttpsProxyLC = "https_proxy";
         private const string EnvHttpsProxyUC = "HTTPS_PROXY";
-        private const string EnvNoProxyLC = "no_proxy";
         private const string EnvNoProxyUC = "NO_PROXY";
         private const string EnvCGI = "GATEWAY_INTERFACE"; // Running in a CGI environment.
 
index ad7555a..e94045b 100644 (file)
@@ -35,7 +35,6 @@ namespace System.Net.Http
     {
         private const string RequestMessageLookupKey = "System.Net.Http.HttpRequestMessage";
         private const string SavedExceptionDispatchInfoLookupKey = "System.Runtime.ExceptionServices.ExceptionDispatchInfo";
-        private const string ClientAuthenticationOID = "1.3.6.1.5.5.7.3.2";
         private static Oid s_serverAuthOid = new Oid("1.3.6.1.5.5.7.3.1", "1.3.6.1.5.5.7.3.1");
         private static readonly Lazy<bool> s_RTCookieUsageBehaviorSupported =
             new Lazy<bool>(InitRTCookieUsageBehaviorSupported);
index 177f822..dc8003e 100644 (file)
@@ -38,7 +38,6 @@ namespace System.Net
         private bool _isDisposed = false;
         internal const uint CertBoblSize = 1500;
         private string _serviceName;
-        private object _lock = new object();
 
         private enum SslStatus : byte
         {
index b24681b..07ebe58 100644 (file)
@@ -111,7 +111,6 @@ namespace System.Net
             return Header;
         }
 
-        private const string CRLF = "\r\n";
         private static readonly byte[] s_CRLFArray = new byte[] { (byte)'\r', (byte)'\n' };
 
         internal HttpResponseStreamAsyncResult(object asyncObject, object userState, AsyncCallback callback, byte[] buffer, int offset, int size, bool chunked, bool sentHeaders, ThreadPoolBoundHandle boundHandle) : base(asyncObject, userState, callback)
index c568487..59220e7 100644 (file)
@@ -14,8 +14,6 @@ namespace System.Net.WebSockets
 {
     internal static partial class HttpWebSocket
     {
-        private static readonly Random s_keyGenerator = new Random();
-
         internal static Task<HttpListenerWebSocketContext> AcceptWebSocketAsync(HttpListenerContext context,
             string subProtocol,
             int receiveBufferSize,
index f21491d..66bc353 100644 (file)
@@ -24,7 +24,6 @@ namespace System.Net.Mail
         private readonly ISmtpAuthenticationModule[] _authenticationModules;
 
         // accounts for the '=' or ' ' character after AUTH
-        private const int SizeOfAuthString = 5;
         private const int SizeOfAuthExtension = 4;
 
         private static readonly char[] s_authExtensionSplitters = new char[] { ' ', '=' };
index 594a34b..d6e2c43 100644 (file)
@@ -4,6 +4,7 @@
     <OutputType>Library</OutputType>
     <ProjectGuid>{3CA89D6C-F8D1-4813-9775-F8D249686E31}</ProjectGuid>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <NoWarn Condition=" '$(TargetsFreeBSD)' == 'true'">$(NoWarn);CA1823</NoWarn>
     <Configurations>netcoreapp-FreeBSD-Debug;netcoreapp-FreeBSD-Release;netcoreapp-Linux-Debug;netcoreapp-Linux-Release;netcoreapp-OSX-Debug;netcoreapp-OSX-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
   </PropertyGroup>
   <ItemGroup>
index bb39416..397d155 100644 (file)
@@ -15,6 +15,8 @@ namespace System.Net.NetworkInformation
 {
     public partial class Ping
     {
+        private const int MaxUdpPacket = 0xFFFF + 256; // Marshal.SizeOf(typeof(Icmp6EchoReply)) * 2 + ip header info;
+
         private static readonly SafeWaitHandle s_nullSafeWaitHandle = new SafeWaitHandle(IntPtr.Zero, true);
         private static readonly object s_socketInitializationLock = new object();
         private static bool s_socketInitialized;
index 924c432..ebb098f 100644 (file)
@@ -15,7 +15,6 @@ namespace System.Net.NetworkInformation
         private const int DefaultSendBufferSize = 32;  // Same as ping.exe on Windows.
         private const int DefaultTimeout = 5000;       // 5 seconds: same as ping.exe on Windows.
         private const int MaxBufferSize = 65500;       // Artificial constraint due to win32 api limitations.
-        private const int MaxUdpPacket = 0xFFFF + 256; // Marshal.SizeOf(typeof(Icmp6EchoReply)) * 2 + ip header info;
 
         private readonly ManualResetEventSlim _lockObject = new ManualResetEventSlim(initialState: true); // doubles as the ability to wait on the current operation
         private SendOrPostCallback _onPingCompletedDelegate;
index 4fca61b..daed778 100644 (file)
@@ -37,9 +37,6 @@ namespace System.Net
         private ResponseDescription _currentResponseDescription;
         protected string _abortReason;
 
-        private const int WaitingForPipeline = 1;
-        private const int CompletedPipeline = 2;
-
         internal CommandStream(TcpClient client)
             : base(client)
         {
index 77a31bf..873e3ba 100644 (file)
@@ -93,8 +93,6 @@ namespace System.Net
         }
         private const string ContinueHeader = "100-continue";
         private const string ChunkedHeader = "chunked";
-        private const string GZipHeader = "gzip";
-        private const string DeflateHeader = "deflate";
 
         public HttpWebRequest()
         {
index 95bdaf3..86f5a45 100644 (file)
@@ -2,10 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System.Collections.Generic;
 using System.ComponentModel;
-using System.Diagnostics;
-using System.Globalization;
 using System.Net.Security;
 using System.Security.Authentication.ExtendedProtection;
 using System.Threading;
@@ -14,8 +11,6 @@ namespace System.Net
 {
     internal partial class NTAuthentication
     {
-        private static ContextCallback s_InitializeCallback = new ContextCallback(InitializeCallback);
-
         internal string AssociatedName
         {
             get
index e1c06da..a339813 100644 (file)
@@ -15,11 +15,6 @@ namespace System.Security.Authentication.ExtendedProtection
     /// </summary>
     public class ExtendedProtectionPolicy : ISerializable
     {
-        private const string policyEnforcementName = "policyEnforcement";
-        private const string protectionScenarioName = "protectionScenario";
-        private const string customServiceNamesName = "customServiceNames";
-        private const string customChannelBindingName = "customChannelBinding";
-
         private ServiceNameCollection _customServiceNames;
         private PolicyEnforcement _policyEnforcement;
         private ProtectionScenario _protectionScenario;
index 6529d79..929b00a 100644 (file)
@@ -17,7 +17,6 @@ namespace System.Net
         private const int ConnectedId = AcceptedId + 1;
         private const int ConnectedAsyncDnsId = ConnectedId + 1;
         private const int NotLoggedFileId = ConnectedAsyncDnsId + 1;
-        private const int DumpArrayId = NotLoggedFileId + 1;
 
         [NonEvent]
         public static void Accepted(Socket socket, object remoteEp, object localEp)
index 4fcb4d1..3524812 100644 (file)
@@ -30,7 +30,6 @@ namespace System.Net.WebSockets
     {
         #region Constants
         private const string HeaderNameCookie = "Cookie";
-        private const string ClientAuthenticationOID = "1.3.6.1.5.5.7.3.2";
         #endregion
 
         private static readonly Lazy<bool> s_MessageWebSocketClientCertificateSupported =
index 6e35912..e7719ad 100644 (file)
@@ -668,7 +668,6 @@ namespace System
         internal const string RFC3986ReservedMarks = @";/?:@&=+$,#[]!'()*";
         private const string RFC2396ReservedMarks = @";/?:@&=+$,";
         private const string RFC3986UnreservedMarks = @"-_.~";
-        private const string RFC2396UnreservedMarks = @"-_.~*'()!";
         private const string AdditionalUnsafeToUnescape = @"%\#";// While not specified as reserved, these are still unsafe to unescape.
 
         // When unescaping in safe mode, do not unescape the RFC 3986 reserved set:
index 5a30696..4f70ef5 100644 (file)
@@ -35,9 +35,7 @@ namespace System.Xml
         private const byte s_maxPrecision = s_NUMERIC_MAX_PRECISION;  // max SS precision
 
         private const int s_cNumeMax = 4;
-        private const long s_lInt32Base = ((long)1) << 32;      // 2**32
         internal const ulong x_llMax = long.MaxValue;   // Max of Int64
-        private const double s_DUINT_BASE = (double)s_lInt32Base;     // 2**32
 
         public BinXmlSqlDecimal(byte[] data, int offset, bool trim)
         {
index f8f5004..14ba3d9 100644 (file)
@@ -288,10 +288,7 @@ namespace System.Xml
         private const int MaxBytesToMove = 128;
         private const int ApproxXmlDeclLength = 80;
         private const int NodesInitialSize = 8;
-        private const int InitialAttributesCount = 4;
-        private const int InitialParsingStateStackSize = 2;
         private const int InitialParsingStatesDepth = 2;
-        private const int DtdChidrenInitialSize = 2;
         private const int MaxByteSequenceLen = 6;  // max bytes per character
         private const int MaxAttrDuplWalkCount = 250;
         private const int MinWhitespaceLookahedCount = 4096;
index 5ef0e49..0768ecc 100644 (file)
@@ -71,7 +71,6 @@ namespace System.Xml
         private const int BUFSIZE = 2048 * 3;       // Should be greater than default FileStream size (4096), otherwise the FileStream will try to cache the data
         private const int ASYNCBUFSIZE = 64 * 1024; // Set async buffer size to 64KB
         private const int OVERFLOW = 32;            // Allow overflow in order to reduce checks when writing out constant size markup
-        private const int INIT_MARKS_COUNT = 64;
 
         //
         // Constructors
index f539ad9..e491e35 100644 (file)
@@ -109,9 +109,6 @@ namespace System.Xml
         private string _xsiSchemaLocation;
         private string _xsiNoNamespaceSchemaLocation;
 
-        //XmlCharType instance
-        private XmlCharType _xmlCharType = XmlCharType.Instance;
-
         //Underlying reader's IXmlLineInfo
         private IXmlLineInfo _lineInfo;
 
index 70fe3c5..528fd27 100644 (file)
@@ -11,8 +11,6 @@ namespace System.Xml.Schema
 
     internal class AutoValidator : BaseValidator
     {
-        private const string x_schema = "x-schema";
-
         public AutoValidator(XmlValidatingReaderImpl reader, XmlSchemaCollection schemaCollection, IValidationEventHandling eventHandling) : base(reader, schemaCollection, eventHandling)
         {
             schemaInfo = new SchemaInfo();
index a916a0c..803ebdb 100644 (file)
@@ -988,7 +988,6 @@ namespace System.Xml.Schema
 
     internal class Numeric10FacetsChecker : FacetsChecker
     {
-        private static readonly char[] s_signs = new char[] { '+', '-' };
         private decimal _maxValue;
         private decimal _minValue;
 
index 05af1e9..ae30a25 100644 (file)
@@ -23,7 +23,6 @@ namespace System.Xml.Schema
         private XmlSchemaObjectTable _identityConstraints = new XmlSchemaObjectTable();
         private Stack _complexTypeStack = new Stack();
         private Hashtable _schemasToCompile = new Hashtable();
-        private Hashtable _importedSchemas = new Hashtable();
 
         private XmlSchema _schemaForSchema;
 
index 90a55e8..2f20db2 100644 (file)
@@ -2,28 +2,18 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Collections;
+using System.IO;
+using System.Text;
+using System.Threading;
+using System.Security;
+using System.Globalization;
+using System.Collections.Generic;
+
 namespace System.Xml.Serialization
 {
-    using System.Configuration;
-    using System.Reflection;
-    using System.Reflection.Emit;
-    using System.Collections;
-    using System.IO;
-    using System;
-    using System.Text;
-    using System.Xml;
-    using System.Threading;
-    using System.Security;
-    using System.Xml.Serialization.Configuration;
-    using System.Diagnostics;
-    using System.Globalization;
-    using System.Runtime.Versioning;
-    using System.Diagnostics.CodeAnalysis;
-    using System.Collections.Generic;
-    using System.Xml.Extensions;
-    using System.Linq;
-    using System.Xml.Serialization;
-
     internal class TempAssembly
     {
         internal const string GeneratedAssemblyNamespace = "Microsoft.Xml.Serialization.GeneratedAssembly";
@@ -32,7 +22,6 @@ namespace System.Xml.Serialization
         private IDictionary _writerMethods;
         private IDictionary _readerMethods;
         private TempMethodDictionary _methods;
-        private Hashtable _assemblies = new Hashtable();
 
         internal class TempMethod
         {
index a4801c1..c1676d5 100644 (file)
@@ -23,7 +23,6 @@ namespace System.Xml.Serialization
 
     internal class Compiler
     {
-        private bool _debugEnabled = DiagnosticsSwitches.KeepTempFiles.Enabled;
         private StringWriter _writer = new StringWriter(CultureInfo.InvariantCulture);
 
         // SxS: This method does not take any resource name and does not expose any resources to the caller.
index 91f49f8..ee8288d 100644 (file)
@@ -104,8 +104,6 @@ namespace System.Xml.Serialization
         private string _guidID;
         private string _timeSpanID;
 
-        private static bool s_checkDeserializeAdvances=false;
-
         protected abstract void InitIDs();
 
         // this method must be called before any generated deserialization methods are called
@@ -2041,7 +2039,6 @@ namespace System.Xml.Serialization
         private Hashtable _createMethods = new Hashtable();
         private int _nextCreateMethodNumber = 0;
         private int _nextIdNumber = 0;
-        private int _nextWhileLoopIndex = 0;
 
         internal Hashtable Enums
         {
index 0abb643..94dfbde 100644 (file)
@@ -25,7 +25,6 @@ namespace System.Xml.Serialization
         private Dictionary<string, FieldBuilder> _idNameFields = new Dictionary<string, FieldBuilder>();
         private Dictionary<string, EnumMapping> _enums;
         private int _nextIdNumber = 0;
-        private int _nextWhileLoopIndex = 0;
 
         internal Dictionary<string, EnumMapping> Enums
         {
index d5ae8ad..9b12ae9 100644 (file)
@@ -1432,7 +1432,6 @@ namespace System.Xml.Serialization
 
     internal static class DynamicAssemblies
     {
-        private static ArrayList s_assembliesInConfig = new ArrayList();
         private static volatile Hashtable s_nameToAssemblyMap = new Hashtable();
         private static volatile Hashtable s_assemblyToNameMap = new Hashtable();
         private static Hashtable s_tableIsTypeDynamic = Hashtable.Synchronized(new Hashtable());
index 7ed07d3..0bf8e88 100644 (file)
@@ -2293,7 +2293,6 @@ namespace System.Xml.Serialization
     internal class ReflectionAwareILGen
     {
         private const string hexDigits = "0123456789ABCDEF";
-        private const string arrayMemberKey = "0";
         // reflectionVariables holds mapping between a reflection entity
         // referenced in the generated code (such as TypeInfo,
         // FieldInfo) and the variable which represent the entity (and
index 0a568e4..5d59739 100644 (file)
@@ -30,8 +30,6 @@ namespace System.Xml.Xsl.IlGen
         private Hashtable _methods;
         private bool _useLRE, _emitSymbols;
 
-        private static readonly Guid s_languageGuid = new Guid(0x462d4a3e, 0xb257, 0x4aee, 0x97, 0xcd, 0x59, 0x18, 0xc7, 0x53, 0x17, 0x58);
-        private static readonly Guid s_vendorGuid = new Guid(0x994b45c4, 0xe6e9, 0x11d2, 0x90, 0x3f, 0x00, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);
         private const string RuntimeName = "{" + XmlReservedNs.NsXslDebug + "}" + "runtime";
 
         private static ModuleBuilder CreateLREModule()
index e461da2..88c0b95 100644 (file)
@@ -27,8 +27,9 @@ namespace System.Xml.Xsl.Qil
     ///
     internal class QilValidationVisitor : QilScopedVisitor
     {
-        private SubstitutionList _subs = new SubstitutionList();
+#if DEBUG
         private QilTypeChecker _typeCheck = new QilTypeChecker();
+#endif
 
         //-----------------------------------------------
         // Entry
index 40d83d3..04c11e6 100644 (file)
@@ -119,65 +119,5 @@ namespace System.Xml.Xsl.Runtime
                 }
             }
         }
-
-        // Most of tables here were taken from MSXML sources and compared with the last
-        // CSS3 proposal available at http://www.w3.org/TR/2002/WD-css3-lists-20021107/
-
-        // MSXML-, CSS3+
-        // CSS3 inserts two new characters U+3090, U+3091 before U+3092
-        private const string hiraganaAiueo =
-            "\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3053" +
-            "\u3055\u3057\u3059\u305b\u305d\u305f\u3061\u3064\u3066\u3068" +
-            "\u306a\u306b\u306c\u306d\u306e\u306f\u3072\u3075\u3078\u307b" +
-            "\u307e\u307f\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308a" +
-            "\u308b\u308c\u308d\u308f\u3092\u3093";
-
-        // MSXML-, CSS3+
-        private const string hiraganaIroha =
-            "\u3044\u308d\u306f\u306b\u307b\u3078\u3068\u3061\u308a\u306c" +
-            "\u308b\u3092\u308f\u304b\u3088\u305f\u308c\u305d\u3064\u306d" +
-            "\u306a\u3089\u3080\u3046\u3090\u306e\u304a\u304f\u3084\u307e" +
-            "\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304d\u3086\u3081" +
-            "\u307f\u3057\u3091\u3072\u3082\u305b\u3059";
-
-        // MSXML+, CSS3+
-        // CSS3 inserts two new characters U+30F0, U+30F1 before U+30F2
-        private const string katakanaAiueo =
-            "\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3" +
-            "\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8" +
-            "\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db" +
-            "\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea" +
-            "\u30eb\u30ec\u30ed\u30ef\u30f2\u30f3";
-
-        // MSXML+, CSS3+
-        // CSS3 removes last U+30F3 character
-        private const string katakanaIroha =
-            "\u30a4\u30ed\u30cf\u30cb\u30db\u30d8\u30c8\u30c1\u30ea\u30cc" +
-            "\u30eb\u30f2\u30ef\u30ab\u30e8\u30bf\u30ec\u30bd\u30c4\u30cd" +
-            "\u30ca\u30e9\u30e0\u30a6\u30f0\u30ce\u30aa\u30af\u30e4\u30de" +
-            "\u30b1\u30d5\u30b3\u30a8\u30c6\u30a2\u30b5\u30ad\u30e6\u30e1" +
-            "\u30df\u30b7\u30f1\u30d2\u30e2\u30bb\u30b9\u30f3";
-
-        // MSXML+, CSS3-
-        private const string katakanaAiueoHw =
-            "\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff7a" +
-            "\uff7b\uff7c\uff7d\uff7e\uff7f\uff80\uff81\uff82\uff83\uff84" +
-            "\uff85\uff86\uff87\uff88\uff89\uff8a\uff8b\uff8c\uff8d\uff8e" +
-            "\uff8f\uff90\uff91\uff92\uff93\uff94\uff95\uff96\uff97\uff98" +
-            "\uff99\uff9a\uff9b\uff9c\uff66\uff9d";
-
-        // MSXML+, CSS3-
-        private const string katakanaIrohaHw =
-            "\uff72\uff9b\uff8a\uff86\uff8e\uff8d\uff84\uff81\uff98\uff87" +
-            "\uff99\uff66\uff9c\uff76\uff96\uff80\uff9a\uff7f\uff82\uff88" +
-            "\uff85\uff97\uff91\uff73\u30f0\uff89\uff75\uff78\uff94\uff8f" +
-            "\uff79\uff8c\uff7a\uff74\uff83\uff71\uff7b\uff77\uff95\uff92" +
-            "\uff90\uff7c\u30f1\uff8b\uff93\uff7e\uff7d\uff9d";
-
-        // MSXML+, CSS3-
-        // Unicode 4.0.0 spec: When used to represent numbers in decimal notation, zero
-        // is represented by U+3007. Otherwise, zero is represented by U+96F6.
-        private const string cjkIdeographic =
-            "\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d";
     }
 }
index b7c9426..403d9af 100644 (file)
@@ -2,12 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System;
-using System.IO;
-using System.Xml;
-using System.Xml.Schema;
 using System.Diagnostics;
-using MS.Internal.Xml;
 
 namespace System.Xml.Xsl.Runtime
 {
@@ -19,7 +14,6 @@ namespace System.Xml.Xsl.Runtime
         private BitStack _stkStrip;
         private bool _shouldStrip, _preserveAdjacent;
         private string _val;
-        private XmlCharType _xmlCharType = XmlCharType.Instance;
 
         public static XmlReader CreateReader(XmlReader baseReader, WhitespaceRuleLookup wsRules)
         {
index 9c1690f..59aa67c 100644 (file)
@@ -24,8 +24,6 @@ namespace System.Xml.Xsl.Runtime
     {
         public static readonly XmlQuerySequence<T> Empty = new XmlQuerySequence<T>();
 
-        private static readonly Type s_XPathItemType = typeof(XPathItem);
-
         private T[] _items;
         private int _size;
 
index 92c5660..5e035c9 100644 (file)
@@ -953,7 +953,6 @@ namespace System.Xml.Xsl
 
             private XmlQueryType _prime;
             private XmlQueryCardinality _card;
-            private XmlValueConverter _converter;
 
             /// <summary>
             /// Create sequence type from prime and cardinality.
index c7dc5f4..5da2001 100644 (file)
@@ -25,8 +25,6 @@ namespace System.Xml.Xsl.Xslt
 {
     internal class Scripts
     {
-        private const string ScriptClassesNamespace = "System.Xml.Xsl.CompiledQuery";
-
         private Compiler _compiler;
         private Dictionary<string, Type> _nsToType = new Dictionary<string, Type>();
         private XmlExtensionFunctionTable _extFuncs = new XmlExtensionFunctionTable();
index c795542..6af1577 100644 (file)
@@ -1325,8 +1325,6 @@ namespace System.Xml.Xsl.Xslt
 
     internal sealed class XslAstRewriter
     {
-        private static readonly QilName s_nullMode = AstFactory.QName(string.Empty);
-
         private CompilerScopeManager<VarPar> _scope;
         private Stack<Template> _newTemplates;
         private Compiler _compiler;
index 16258f1..fcd1363 100644 (file)
@@ -768,17 +768,6 @@ namespace System.Xml.Xsl.XsltOld
         // Script support
         //
         private Hashtable[] _typeDeclsByLang = new Hashtable[] { new Hashtable(), new Hashtable(), new Hashtable() };
-        private ArrayList _scriptFiles = new ArrayList();
-        // Namespaces we always import when compiling
-        private static string[] s_defaultNamespaces = new string[] {
-            "System",
-            "System.Collections",
-            "System.Text",
-            "System.Text.RegularExpressions",
-            "System.Xml",
-            "System.Xml.Xsl",
-            "System.Xml.XPath",
-        };
 
         internal void AddScript(string source, ScriptingLanguage lang, string ns, string fileName, int lineNumber)
         {
index 69be260..395fdce 100644 (file)
@@ -2,17 +2,14 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
+using System.Diagnostics;
+using System.Xml.XPath;
+
 namespace System.Xml.Xsl.XsltOld
 {
-    using System;
-    using System.Diagnostics;
-    using System.Xml;
-    using System.Xml.XPath;
-
     internal sealed class CopyNamespacesAction : Action
     {
         private const int BeginEvent = 2;
-        private const int TextEvent = 3;
         private const int EndEvent = 4;
         private const int Advance = 5;
 
index 212e353..13f4ba4 100644 (file)
@@ -2,25 +2,18 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
+using System.Diagnostics;
+using System.Text;
+using System.Globalization;
+using System.Collections;
+using System.Collections.Generic;
+using System.Xml.XPath;
+using System.Xml.Xsl.Runtime;
+
 namespace System.Xml.Xsl.XsltOld
 {
-    using System.Diagnostics;
-    using System.Text;
-    using System.Globalization;
-    using System.Collections;
-    using System.Collections.Generic;
-    using System.Xml.XPath;
-    using System.Xml.Xsl.Runtime;
-
     internal class NumberAction : ContainerAction
     {
-        private const long msofnfcNil = 0x00000000;     // no flags
-        private const long msofnfcTraditional = 0x00000001;     // use traditional numbering
-        private const long msofnfcAlwaysFormat = 0x00000002;     // if requested format is not supported, use Arabic (Western) style
-
-        private const int cchMaxFormat = 63;     // max size of formatted result
-        private const int cchMaxFormatDecimal = 11;    // max size of formatted decimal result (doesn't handle the case of a very large pwszSeparator or minlen)
-
         internal class FormatInfo
         {
             public bool isSeparator;      // False for alphanumeric strings of chars
index e0526a3..aa57b15 100644 (file)
@@ -11,7 +11,6 @@ namespace System.Xml.Xsl.XsltOld
 
     internal class ProcessingInstructionAction : ContainerAction
     {
-        private const int NameEvaluated = 2;
         private const int NameReady = 3;
 
         private Avt _nameAvt;
index 46e5f0b..ba085c0 100644 (file)
@@ -37,7 +37,6 @@ namespace System.Xml.Xsl.XsltOld
         private const string s_EncodingStart = " encoding=\"";
         private const string s_Public = "PUBLIC ";
         private const string s_System = "SYSTEM ";
-        private const string s_Html = "html";
         private const string s_QuoteSpace = "\" ";
         private const string s_CDataSplit = "]]]]><![CDATA[>";
 
index f516f94..5859155 100644 (file)
@@ -48,8 +48,10 @@ namespace System.Xml.Xsl
         // Reader settings used when creating XmlReader from inputUri
         private static readonly XmlReaderSettings s_readerSettings = new XmlReaderSettings();
 
+#if FEATURE_COMPILED_XSL
         // Version for GeneratedCodeAttribute
         private static readonly Version s_version = typeof(XslCompiledTransform).Assembly.GetName().Version;
+#endif
 
         // Options of compilation
         private bool _enableDebug = false;
index a21dc44..95926b3 100644 (file)
@@ -90,9 +90,7 @@ namespace System.Reflection.Metadata
         private const byte ILFatFormatHeaderSize = 0x03;
         private const int ILFatFormatHeaderSizeShift = 4;
         private const byte SectEHTable = 0x01;
-        private const byte SectOptILTable = 0x02;
         private const byte SectFatFormat = 0x40;
-        private const byte SectMoreSects = 0x40;
 
         public static MethodBodyBlock Create(BlobReader reader)
         {
index 419ed1b..12824b7 100644 (file)
@@ -1354,8 +1354,6 @@ namespace System.Reflection.Metadata
             return TypeDefTable.FindTypeContainingField(fieldRowId, FieldTable.NumberOfRows);
         }
 
-        private static readonly ObjectPool<StringBuilder> s_stringBuilderPool = new ObjectPool<StringBuilder>(() => new StringBuilder());
-
         public string GetString(DocumentNameBlobHandle handle)
         {
             return BlobHeap.GetDocumentName(handle);
index fb49661..b471493 100644 (file)
@@ -212,7 +212,6 @@ namespace System.Reflection.TypeLoading
             private readonly GetTypeCoreCache _owner;
 
             private const int _initialCapacity = 5;
-            private const double _growThreshold = 0.75;
         }
 
         private struct Entry
index d203075..ec257f9 100644 (file)
@@ -45,7 +45,6 @@ namespace System.Reflection.TypeLoading
         {
             return _pointerDict.GetOrAdd(elementType, (e) => new RoPointerType(e));
         }
-        private static readonly Func<RoType, RoPointerType> s_pointerTypeFactory = (e) => new RoPointerType(e);
         private readonly ConcurrentDictionary<RoType, RoPointerType> _pointerDict = new ConcurrentDictionary<RoType, RoPointerType>();
 
         //
index 00ce189..bfa82c7 100644 (file)
@@ -19,7 +19,6 @@ namespace System.Runtime.Caching
         static internal readonly ExpiresEntryRef INVALID = new ExpiresEntryRef(0, 0);
 
         private const uint ENTRY_MASK = 0x000000ffu;
-        private const uint PAGE_MASK = 0xffffff00u;
         private const int PAGE_SHIFT = 8;
 
         private uint _ref;
index 4b7ae26..2d287de 100644 (file)
@@ -19,7 +19,6 @@ namespace System.Runtime.Caching
         static internal readonly UsageEntryRef INVALID = new UsageEntryRef(0, 0);
 
         private const uint ENTRY_MASK = 0x000000ffu;
-        private const uint PAGE_MASK = 0xffffff00u;
         private const int PAGE_SHIFT = 8;
 
         private uint _ref;
@@ -863,7 +862,6 @@ namespace System.Runtime.Caching
         internal static readonly TimeSpan CORRELATED_REQUEST_TIMEOUT = new TimeSpan(0, 0, 1);
         internal static readonly TimeSpan MIN_LIFETIME_FOR_USAGE = NEWADD_INTERVAL;
         private const byte NUMBUCKETS = 1;
-        private const int MAX_REMOVE = 1024;
 
         private readonly MemoryCacheStore _cacheStore;
         internal readonly UsageBucket[] _buckets;
index 6a48a72..6038a75 100644 (file)
@@ -19,6 +19,11 @@ namespace System.Runtime.Caching
         internal static void Trace(string tagName, string message, Exception e = null)
         {
 #if DEBUG
+            if (!s_tracingEnabled)
+            {
+                return;
+            }
+
             string exceptionMessage =
                 e is null ? null :
                 e is ExternalException ee ? "Exception " + e + Environment.NewLine + "_hr=0x" + ee.ErrorCode.ToString("x", CultureInfo.InvariantCulture) :
index c36f6c1..f6e96f2 100644 (file)
@@ -10,7 +10,6 @@ namespace System.Runtime.InteropServices
     {
         private static readonly object s_osLock = new object();
         private static readonly object s_processLock = new object();
-        private static readonly bool s_is64BitProcess = IntPtr.Size == 8;
         private static string s_osPlatformName;
         private static string s_osDescription;
         private static Architecture? s_osArch;
index 04c95fb..de0e04d 100644 (file)
@@ -11,7 +11,6 @@ namespace System.Numerics
     [System.Runtime.CompilerServices.TypeForwardedFrom("System.Numerics, Version=4.0.0.0, PublicKeyToken=b77a5c561934e089")]
     public readonly struct BigInteger : IFormattable, IComparable, IComparable<BigInteger>, IEquatable<BigInteger>
     {
-        private const int knMaskHighBit = int.MinValue;
         private const uint kuMaskHighBit = unchecked((uint)int.MinValue);
         private const int kcbitUint = 32;
         private const int kcbitUlong = 64;
index 33bd88c..486c85d 100644 (file)
@@ -107,9 +107,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
     {
         const string WinRTNotifyCollectionChangedEventArgsName = "Windows.UI.Xaml.Interop.NotifyCollectionChangedEventArgs";
 
-        // IBindableVector Guid
-        static Guid IID_IBindableVector = new Guid("393de7de-6fd0-4c0d-bb71-47244a113e93");
-
         static INotifyCollectionChangedEventArgsFactory s_EventArgsFactory;
 
         // Extracts properties from a managed NotifyCollectionChangedEventArgs and passes them to
index 0d5cc03..993fdfa 100644 (file)
@@ -14,13 +14,6 @@ namespace System.Security.Claims
     /// </summary>
     public class ClaimsIdentity : IIdentity
     {
-        private const string PreFix = "System.Security.ClaimsIdentity.";
-        private const string AuthenticationTypeKey = PreFix + "authenticationType";
-        private const string LabelKey = PreFix + "label";
-        private const string NameClaimTypeKey = PreFix + "nameClaimType";
-        private const string RoleClaimTypeKey = PreFix + "roleClaimType";
-        private const string VersionKey = PreFix + "version";
-
         private enum SerializationMask
         {
             None = 0,
index 00126f2..e91cd41 100644 (file)
@@ -62,7 +62,6 @@ namespace Internal.Cryptography
         }
 
         private const int SizeOf_NCRYPT_KEY_BLOB_HEADER_SIZE = sizeof(int) + sizeof(int) + sizeof(int) + sizeof(int);
-        private const int SizeOf_BCRYPT_KEY_DATA_BLOB_HEADER = sizeof(int) + sizeof(int) + sizeof(int);
 
         private static readonly CngKeyBlobFormat s_cipherKeyBlobFormat = new CngKeyBlobFormat(Interop.NCrypt.NCRYPT_CIPHER_KEY_BLOB);
     }
index 570c548..4970d3b 100644 (file)
@@ -7,9 +7,7 @@
 //  Ported from windows c_iscii.  If you find bugs here, there are likely similar
 //  bugs in the windows version
 
-using System;
 using System.Diagnostics;
-using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System.Text
@@ -30,17 +28,7 @@ namespace System.Text
     internal class ISCIIEncoding : EncodingNLS, ISerializable
     {
         // Constants
-        private const int CodeDefault = 0;    // 0x40       Default
-        private const int CodeRoman = 1;    // 0x41       Roman Transliteration (not supported)
         private const int CodeDevanagari = 2;    // 0x42 57002
-        private const int CodeBengali = 3;    // 0x43 57003
-        private const int CodeTamil = 4;    // 0x44 57004
-        private const int CodeTelugu = 5;    // 0x45 57005
-        private const int CodeAssamese = 6;    // 0x46 57006 Assamese (Bengali)
-        private const int CodeOriya = 7;    // 0x47 57007
-        private const int CodeKannada = 8;    // 0x48 57008
-        private const int CodeMalayalam = 9;    // 0x49 57009
-        private const int CodeGujarati = 10;   // 0x4a 57010
         private const int CodePunjabi = 11;   // 0x4b 57011 Punjabi (Gurmukhi)
 
         // Ranges
index 4986bf0..fec6ed4 100644 (file)
@@ -32,7 +32,6 @@ namespace System.Text.Json
             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // U+0070..U+007F
         };
 
-        private const string HexFormatString = "X4";
         private static readonly StandardFormat s_hexStandardFormat = new StandardFormat('X', 4);
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -596,7 +595,7 @@ namespace System.Text.Json
                     destination[written++] = 'u';
 #if BUILDING_INBOX_LIBRARY
                     int intChar = value;
-                    intChar.TryFormat(destination.Slice(written), out int charsWritten, HexFormatString);
+                    intChar.TryFormat(destination.Slice(written), out int charsWritten, "X4");
                     Debug.Assert(charsWritten == 4);
                     written += charsWritten;
 #else
index f149b24..8767202 100644 (file)
@@ -37,7 +37,6 @@ namespace System.Text.RegularExpressions
         private const string NullCharString = "\0";
         private const char NullChar = '\0';
         private const char LastChar = '\uFFFF';
-        private const char GroupChar = (char)0;
 
         private const short SpaceConst = 100;
         private const short NotSpaceConst = -100;
@@ -1219,6 +1218,7 @@ namespace System.Text.RegularExpressions
                 {
                     bool found = false;
 
+                    const char GroupChar = (char)0;
                     int lastindex = set.IndexOf(GroupChar, index + 1);
                     string group = set.Substring(index, lastindex - index + 1);
 
index bc66ba6..0dca404 100644 (file)
@@ -103,7 +103,6 @@ namespace System.Text.RegularExpressions
         // indices for unique code fragments
         private const int Stackpop = 0;    // pop one
         private const int Stackpop2 = 1;    // pop two
-        private const int Stackpop3 = 2;    // pop three
         private const int Capback = 3;    // uncapture
         private const int Capback2 = 4;    // uncapture 2
         private const int Branchmarkback2 = 5;    // back2 part of branchmark
index 904c3eb..43b7342 100644 (file)
@@ -45,8 +45,6 @@ namespace System.Threading
         // CDS Synchronization Event IDs (must be unique)
         //
 
-        private const int SPINLOCK_FASTPATHFAILED_ID = 1;
-        private const int SPINWAIT_NEXTSPINWILLYIELD_ID = 2;
         private const int BARRIER_PHASEFINISHED_ID = 3;
 
 
index 0fbac5d..06aadb8 100644 (file)
@@ -135,7 +135,6 @@ namespace System.Transactions
 
         // Store the number of ticks.  A tick is a mark of 1 timer interval.  By counting ticks
         // we can avoid expensive calls to get the current time for every transaction creation.
-        private const long TicksPerMillisecond = 10000;
         private long _ticks;
         private long _lastTimerTime;