[main] Update dependencies from dotnet/roslyn-analyzers (#86793)
authordotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Mon, 29 May 2023 16:53:50 +0000 (11:53 -0500)
committerGitHub <noreply@github.com>
Mon, 29 May 2023 16:53:50 +0000 (11:53 -0500)
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230525.7

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23270.2 -> To Version 3.3.5-beta1.23275.7

* Fix new findings with CA1822 analyzer

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
45 files changed:
eng/Version.Details.xml
eng/Versions.props
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/CustomAttributes/RuntimeCustomAttributeData.cs
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/TypeInfos/RuntimeArrayTypeInfo.cs
src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.SignatureParsing.cs
src/coreclr/tools/Common/TypeSystem/Common/MetadataRuntimeInterfacesAlgorithm.cs
src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NativeLayoutVertexNode.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/Graph.Cycles.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/GraphBuilder.ForEach.cs
src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs
src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Configuration.cs
src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/MgmtConfigurationRecord.cs
src/libraries/System.Data.Common/src/System/Data/DataSet.cs
src/libraries/System.Data.Common/src/System/Data/DataTable.cs
src/libraries/System.Data.Common/src/System/Data/DataView.cs
src/libraries/System.Data.Common/src/System/Data/DataViewManager.cs
src/libraries/System.Data.Common/src/System/Data/Select.cs
src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs
src/libraries/System.Linq.Queryable/src/System/Linq/EnumerableRewriter.cs
src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatReaderGenerator.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionClassWriter.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionReader.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionXmlFormatReader.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SchemaImporter.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs
src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlCharacterData.cs
src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlSignificantWhiteSpace.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaCollectionCompiler.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaCollectionpreProcessor.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaSetCompiler.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchema.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSet.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/Models.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlIlVisitor.cs
src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs
src/mono/System.Private.CoreLib/src/System/Array.Mono.cs
src/mono/wasm/host/Options.cs

index 77d82b1..b2d2ecb 100644 (file)
       <Uri>https://github.com/dotnet/roslyn</Uri>
       <Sha>0cb0d5796b336c6a746e6d14c129f2e2b44f4f5e</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23270.2">
+    <Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.3.5-beta1.23275.7">
       <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
-      <Sha>c30ffa69aadaf557d5f8be198ec868f8fa364c3f</Sha>
+      <Sha>2b6ab8d727ce73a78bcbf026ac75ea8a7c804daf</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23270.2">
+    <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23275.7">
       <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
-      <Sha>c30ffa69aadaf557d5f8be198ec868f8fa364c3f</Sha>
+      <Sha>2b6ab8d727ce73a78bcbf026ac75ea8a7c804daf</Sha>
     </Dependency>
     <Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="8.0.100-preview.2.23107.1">
       <Uri>https://github.com/dotnet/sdk</Uri>
index 3313d30..3811621 100644 (file)
@@ -32,8 +32,8 @@
   </ItemGroup>
   <PropertyGroup>
     <!-- dotnet/roslyn-analyzers dependencies -->
-    <MicrosoftCodeAnalysisAnalyzersVersion>3.3.5-beta1.23270.2</MicrosoftCodeAnalysisAnalyzersVersion>
-    <MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview.23270.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
+    <MicrosoftCodeAnalysisAnalyzersVersion>3.3.5-beta1.23275.7</MicrosoftCodeAnalysisAnalyzersVersion>
+    <MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview.23275.7</MicrosoftCodeAnalysisNetAnalyzersVersion>
     <!-- dotnet/roslyn dependencies -->
     <!--
       These versions should not be used by any project that contributes to the design-time experience in VS, such as an analyzer, code-fix, or generator assembly.
index 842ebaf..b7ec740 100644 (file)
@@ -243,7 +243,7 @@ namespace System.Reflection.Emit
         }
 
         // Check that a type is suitable for use in a custom attribute.
-        private bool ValidateType(Type t)
+        private static bool ValidateType(Type t)
         {
             if (t.IsPrimitive)
             {
index 26b43b4..a181e5d 100644 (file)
@@ -152,7 +152,7 @@ namespace System.Reflection.Runtime.CustomAttributes
         // Wrap a custom attribute argument (or an element of an array-typed custom attribute argument) in a CustomAttributeTypeArgument structure
         // for insertion into a CustomAttributeData value.
         //
-        protected CustomAttributeTypedArgument WrapInCustomAttributeTypedArgument(object? value, Type argumentType)
+        protected static CustomAttributeTypedArgument WrapInCustomAttributeTypedArgument(object? value, Type argumentType)
         {
             if (argumentType == typeof(object))
             {
index cbaf544..ba9c214 100644 (file)
@@ -308,7 +308,7 @@ namespace System.Reflection.Runtime.TypeInfos
         //
         // Helper for jagged array constructors.
         //
-        private Array CreateJaggedArray(RuntimeTypeInfo arrayType, int[] lengths, int index)
+        private static Array CreateJaggedArray(RuntimeTypeInfo arrayType, int[] lengths, int index)
         {
             int length = lengths[index];
             Array jaggedArray = ReflectionCoreExecution.ExecutionEnvironment.NewArray(arrayType.TypeHandle, length);
index 3a2dc3b..52e014d 100644 (file)
@@ -161,7 +161,7 @@ namespace Internal.Runtime.TypeLoader
 
         #region Private Helpers
 
-        private bool TryGetTypeFromSimpleTypeSignature(ref NativeParser parser, NativeFormatModuleInfo moduleHandle, out RuntimeTypeHandle typeHandle)
+        private static bool TryGetTypeFromSimpleTypeSignature(ref NativeParser parser, NativeFormatModuleInfo moduleHandle, out RuntimeTypeHandle typeHandle)
         {
             uint data;
             TypeSignatureKind kind = parser.GetTypeSignatureKind(out data);
@@ -222,7 +222,7 @@ namespace Internal.Runtime.TypeLoader
             }
         }
 
-        private bool CompareMethodSigs(NativeParser parser1, NativeFormatModuleInfo moduleHandle1, NativeParser parser2, NativeFormatModuleInfo moduleHandle2)
+        private static bool CompareMethodSigs(NativeParser parser1, NativeFormatModuleInfo moduleHandle1, NativeParser parser2, NativeFormatModuleInfo moduleHandle2)
         {
             MethodCallingConvention callingConvention1 = (MethodCallingConvention)parser1.GetUnsigned();
             MethodCallingConvention callingConvention2 = (MethodCallingConvention)parser2.GetUnsigned();
@@ -251,7 +251,7 @@ namespace Internal.Runtime.TypeLoader
             return true;
         }
 
-        private bool CompareTypeSigs(ref NativeParser parser1, NativeFormatModuleInfo moduleHandle1, ref NativeParser parser2, NativeFormatModuleInfo moduleHandle2)
+        private static bool CompareTypeSigs(ref NativeParser parser1, NativeFormatModuleInfo moduleHandle1, ref NativeParser parser2, NativeFormatModuleInfo moduleHandle2)
         {
             // startOffset lets us backtrack to the TypeSignatureKind for external types since the TypeLoader
             // expects to read it in.
index fa3f125..94c7500 100644 (file)
@@ -46,7 +46,7 @@ namespace Internal.TypeSystem
         /// <summary>
         /// Metadata based computation of interfaces.
         /// </summary>
-        private DefType[] ComputeRuntimeInterfacesForNonInstantiatedMetadataType(MetadataType type)
+        private static DefType[] ComputeRuntimeInterfacesForNonInstantiatedMetadataType(MetadataType type)
         {
             DefType[] explicitInterfaces = type.ExplicitlyImplementedInterfaces;
             DefType[] baseTypeInterfaces = (type.BaseType != null) ? (type.BaseType.RuntimeInterfaces) : Array.Empty<DefType>();
@@ -69,7 +69,7 @@ namespace Internal.TypeSystem
         /// <summary>
         /// Add an interface and its required interfaces to the interfacesArray
         /// </summary>
-        private void BuildPostOrderInterfaceList(DefType iface, ref ArrayBuilder<DefType> interfacesArray)
+        private static void BuildPostOrderInterfaceList(DefType iface, ref ArrayBuilder<DefType> interfacesArray)
         {
             if (interfacesArray.Contains(iface))
                 return;
index 4097924..d3a2e83 100644 (file)
@@ -1298,7 +1298,7 @@ namespace Internal.TypeSystem.Ecma
         //
         // Gather the local details in a scope and then recurse to child scopes
         //
-        private void ProbeScopeForLocals(List<ILLocalVariable> variables, ISymUnmanagedScope scope)
+        private static void ProbeScopeForLocals(List<ILLocalVariable> variables, ISymUnmanagedScope scope)
         {
             int localCount;
             ThrowExceptionForHR(scope.GetLocalCount(out localCount));
index d0e19c3..574176b 100644 (file)
@@ -1359,7 +1359,7 @@ namespace ILCompiler.DependencyAnalysis
         /// Do not adjust vtable index for generic dictionary slot
         /// The vtable index is only actually valid if whichEntries is set to VTableEntriesToProcess.AllInVTable
         /// </summary>
-        private void ProcessVTableEntriesForCallingConventionSignatureGeneration(NodeFactory factory, VTableEntriesToProcess whichEntries, ref int currentVTableIndex, Action<int, bool, MethodDesc, MethodDesc> operation, TypeDesc implType, TypeDesc declType, TypeDesc templateType)
+        private static void ProcessVTableEntriesForCallingConventionSignatureGeneration(NodeFactory factory, VTableEntriesToProcess whichEntries, ref int currentVTableIndex, Action<int, bool, MethodDesc, MethodDesc> operation, TypeDesc implType, TypeDesc declType, TypeDesc templateType)
         {
             if (implType.IsInterface)
                 return;
index 2d643c0..544fceb 100644 (file)
@@ -321,7 +321,7 @@ ReturnFromEndOfRecursiveFunction:
             /// <remarks>
             /// "alreadySeen" is actually a stack but we use a List&lt;&gt; because Stack&lt;&gt; doesn't support indexing.
             /// </remarks>
-            private void FindCyclesWorker(Edge edge, List<Edge> alreadySeen, ref int operationCount, Stopwatch previousAlgorithmTimeoutWatch)
+            private static void FindCyclesWorker(Edge edge, List<Edge> alreadySeen, ref int operationCount, Stopwatch previousAlgorithmTimeoutWatch)
             {
                 Vertex vertex = edge.Destination;
 
index 5743823..6224974 100644 (file)
@@ -24,12 +24,12 @@ namespace ILCompiler
             /// This method also records bindings for any generic instances it finds inside the tree expression.
             /// Sometimes, this side-effect is all that's wanted - in such cases, invoke this method with a default collector.
             /// </summary>
-            private void ForEachEmbeddedGenericFormal(TypeDesc typeExpression, Instantiation typeContext, Instantiation methodContext, ref EmbeddingStateList collector)
+            private static void ForEachEmbeddedGenericFormal(TypeDesc typeExpression, Instantiation typeContext, Instantiation methodContext, ref EmbeddingStateList collector)
             {
                 ForEachEmbeddedGenericFormalWorker(typeExpression, typeContext, methodContext, ref collector, depth: 0);
             }
 
-            private void ForEachEmbeddedGenericFormalWorker(TypeDesc type, Instantiation typeContext, Instantiation methodContext, ref EmbeddingStateList collector, int depth)
+            private static void ForEachEmbeddedGenericFormalWorker(TypeDesc type, Instantiation typeContext, Instantiation methodContext, ref EmbeddingStateList collector, int depth)
             {
                 switch (type.Category)
                 {
index 3077c2b..85846d8 100644 (file)
@@ -298,7 +298,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop
         // We will try VT_DISPATCH and then call GetNativeVariantForObject.
         private const VarEnum VT_DEFAULT = VarEnum.VT_RECORD;
 
-        private VarEnum GetComType(ref Type argumentType)
+        private static VarEnum GetComType(ref Type argumentType)
         {
             if (argumentType == typeof(Missing))
             {
@@ -378,7 +378,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop
         /// Get the COM Variant type that argument should be marshaled as for a call to COM
         /// </summary>
         [RequiresUnreferencedCode(Binder.TrimmerWarning)]
-        private VariantBuilder GetVariantBuilder(Type argumentType)
+        private static VariantBuilder GetVariantBuilder(Type argumentType)
         {
             //argumentType is coming from MarshalType, null means the dynamic object holds
             //a null value and not byref
index b2bd0a8..e83798d 100644 (file)
@@ -765,7 +765,7 @@ namespace Microsoft.VisualBasic
             OutputType(typeRef);
         }
 
-        private string GetArrayPostfix(CodeTypeReference typeRef)
+        private static string GetArrayPostfix(CodeTypeReference typeRef)
         {
             string s = "";
             if (typeRef.ArrayElementType != null)
index 844b556..c0495b2 100644 (file)
@@ -1421,7 +1421,7 @@ namespace System.Configuration
             return section;
         }
 
-        private ConfigXmlReader FindSectionRecursive(string[] keys, int iKey, XmlUtil xmlUtil, ref int lineNumber)
+        private static ConfigXmlReader FindSectionRecursive(string[] keys, int iKey, XmlUtil xmlUtil, ref int lineNumber)
         {
             string name = keys[iKey];
             ConfigXmlReader section = null;
index 645cea2..69631d5 100644 (file)
@@ -217,7 +217,7 @@ namespace System.Configuration
         }
 
         // Force all sections and section groups to be instantiated.
-        private void ForceGroupsRecursive(ConfigurationSectionGroup group)
+        private static void ForceGroupsRecursive(ConfigurationSectionGroup group)
         {
             foreach (ConfigurationSection configSection in group.Sections)
             {
index a2c6d0e..31e1487 100644 (file)
@@ -2368,7 +2368,7 @@ namespace System.Configuration
             }
         }
 
-        private bool CopyConfigDeclarationsRecursive(
+        private static bool CopyConfigDeclarationsRecursive(
             SectionUpdates declarationUpdates, XmlUtil xmlUtil, XmlUtilWriter utilWriter, string group,
             int parentLinePosition, int parentIndent)
         {
index a925c87..37c1fb2 100644 (file)
@@ -3339,7 +3339,7 @@ namespace System.Data
         }
 
         // SDUB: may be better to rewrite this as nonrecursive?
-        internal DataTable? FindTable(DataTable? baseTable, PropertyDescriptor[] props, int propStart)
+        internal static DataTable? FindTable(DataTable? baseTable, PropertyDescriptor[] props, int propStart)
         {
             if (props.Length < propStart + 1)
             {
index 2da38f2..71813c5 100644 (file)
@@ -2352,7 +2352,7 @@ namespace System.Data
             return targetTable;
         }
 
-        private DataTable CloneHierarchy(DataTable sourceTable, DataSet ds, Hashtable? visitedMap)
+        private static DataTable CloneHierarchy(DataTable sourceTable, DataSet ds, Hashtable? visitedMap)
         {
             visitedMap ??= new Hashtable();
             if (visitedMap.Contains(sourceTable))
@@ -5496,7 +5496,7 @@ namespace System.Data
             WriteXmlSchema(w, writeHierarchy);
         }
 
-        private bool CheckForClosureOnExpressions(DataTable dt, bool writeHierarchy)
+        private static bool CheckForClosureOnExpressions(DataTable dt, bool writeHierarchy)
         {
             List<DataTable> tableList = new List<DataTable>();
             tableList.Add(dt);
@@ -6617,7 +6617,7 @@ namespace System.Data
             }
         }
 
-        private void CreateTableList(DataTable currentTable, List<DataTable> tableList)
+        private static void CreateTableList(DataTable currentTable, List<DataTable> tableList)
         {
             foreach (DataRelation r in currentTable.ChildRelations)
             {
index f05b7ec..8babfcf 100644 (file)
@@ -1164,7 +1164,7 @@ namespace System.Data
                     DataSet? dataSet = _table.DataSet;
                     if (dataSet != null)
                     {
-                        DataTable? foundTable = dataSet.FindTable(_table, listAccessors, 0);
+                        DataTable? foundTable = DataSet.FindTable(_table, listAccessors, 0);
                         if (foundTable != null)
                         {
                             return foundTable.TableName;
@@ -1191,7 +1191,7 @@ namespace System.Data
                         return new PropertyDescriptorCollection(null);
                     }
 
-                    DataTable? foundTable = dataSet.FindTable(_table, listAccessors, 0);
+                    DataTable? foundTable = DataSet.FindTable(_table, listAccessors, 0);
                     if (foundTable != null)
                     {
                         return foundTable.GetPropertyDescriptorCollection();
index 8c8c7a3..58b72f3 100644 (file)
@@ -270,7 +270,7 @@ namespace System.Data
             }
             else
             {
-                DataTable? table = dataSet.FindTable(null, listAccessors, 0);
+                DataTable? table = DataSet.FindTable(null, listAccessors, 0);
                 if (table != null)
                 {
                     return table.TableName;
@@ -293,7 +293,7 @@ namespace System.Data
             }
             else
             {
-                DataTable? table = dataSet.FindTable(null, listAccessors, 0);
+                DataTable? table = DataSet.FindTable(null, listAccessors, 0);
                 if (table != null)
                 {
                     return table.GetPropertyDescriptorCollection();
index ee687c6..446d3cb 100644 (file)
@@ -452,7 +452,7 @@ namespace System.Data
         }
 
 
-        private bool IsOperatorIn(ExpressionNode? enode)
+        private static bool IsOperatorIn(ExpressionNode? enode)
         {
             BinaryNode? bnode = (enode as BinaryNode);
             if (null != bnode)
index 8744eef..9a46051 100644 (file)
@@ -868,7 +868,7 @@ namespace System.Data
                 }
         }
 
-        internal XmlSchemaObjectCollection? GetParticleItems(XmlSchemaParticle? pt)
+        internal static XmlSchemaObjectCollection? GetParticleItems(XmlSchemaParticle? pt)
         {
             if (pt is XmlSchemaSequence)
                 return ((XmlSchemaSequence)pt).Items;
index d73e122..bcd5b71 100644 (file)
@@ -60,7 +60,7 @@ namespace System.Linq
             return m;
         }
 
-        private ReadOnlyCollection<Expression> FixupQuotedArgs(MethodInfo mi, ReadOnlyCollection<Expression> argList)
+        private static ReadOnlyCollection<Expression> FixupQuotedArgs(MethodInfo mi, ReadOnlyCollection<Expression> argList)
         {
             ParameterInfo[] pis = mi.GetParameters();
             if (pis.Length > 0)
@@ -88,7 +88,7 @@ namespace System.Linq
             return argList;
         }
 
-        private Expression FixupQuotedExpression(Type type, Expression expression)
+        private static Expression FixupQuotedExpression(Type type, Expression expression)
         {
             Expression expr = expression;
             while (true)
index 6759065..a19e332 100644 (file)
@@ -573,7 +573,7 @@ namespace System.Reflection
             }
         }
 
-        private bool TryPopulateNullabilityInfo(NullabilityInfo nullability, NullableAttributeStateParser parser, ref int index)
+        private static bool TryPopulateNullabilityInfo(NullabilityInfo nullability, NullableAttributeStateParser parser, ref int index)
         {
             bool isValueType = IsValueTypeOrValueTypeByRef(nullability.Type);
             if (!isValueType)
index f2437ec..2f366ea 100644 (file)
@@ -419,7 +419,7 @@ namespace System.Runtime.Serialization.Json
                 _ilg.Load(localArray);
             }
 
-            private int SetRequiredElements(ClassDataContract contract, byte[] requiredElements)
+            private static int SetRequiredElements(ClassDataContract contract, byte[] requiredElements)
             {
                 int memberCount = (contract.BaseClassContract == null) ? 0 :
                     SetRequiredElements(contract.BaseClassContract, requiredElements);
index b15050b..a519063 100644 (file)
@@ -127,7 +127,7 @@ namespace System.Runtime.Serialization
             return true;
         }
 
-        private void InvokeOnSerializing(object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract)
+        private static void InvokeOnSerializing(object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract)
         {
             if (classContract.BaseClassContract != null)
                 InvokeOnSerializing(obj, context, classContract.BaseClassContract);
@@ -138,7 +138,7 @@ namespace System.Runtime.Serialization
             }
         }
 
-        private void InvokeOnSerialized(object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract)
+        private static void InvokeOnSerialized(object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract)
         {
             if (classContract.BaseClassContract != null)
                 InvokeOnSerialized(obj, context, classContract.BaseClassContract);
index f457a07..95ff4fc 100644 (file)
@@ -208,7 +208,7 @@ namespace System.Runtime.Serialization
             return false;
         }
 
-        protected int ReflectionGetMembers(ClassDataContract classContract, DataMember[] members)
+        protected static int ReflectionGetMembers(ClassDataContract classContract, DataMember[] members)
         {
             int memberCount = (classContract.BaseClassContract == null) ? 0 : ReflectionGetMembers(classContract.BaseClassContract, members);
             int childElementIndex = memberCount;
@@ -395,7 +395,7 @@ namespace System.Runtime.Serialization
             return context.InternalDeserialize(xmlReader, DataContract.GetId(type.TypeHandle), type.TypeHandle, name, ns);
         }
 
-        private void InvokeOnDeserializing(XmlObjectSerializerReadContext context, ClassDataContract classContract, object obj)
+        private static void InvokeOnDeserializing(XmlObjectSerializerReadContext context, ClassDataContract classContract, object obj)
         {
             if (classContract.BaseClassContract != null)
                 InvokeOnDeserializing(context, classContract.BaseClassContract, obj);
@@ -406,7 +406,7 @@ namespace System.Runtime.Serialization
             }
         }
 
-        private void InvokeOnDeserialized(XmlObjectSerializerReadContext context, ClassDataContract classContract, object obj)
+        private static void InvokeOnDeserialized(XmlObjectSerializerReadContext context, ClassDataContract classContract, object obj)
         {
             if (classContract.BaseClassContract != null)
                 InvokeOnDeserialized(context, classContract.BaseClassContract, obj);
index 70fab59..8a5a4e4 100644 (file)
@@ -128,7 +128,7 @@ namespace System.Runtime.Serialization
             return collectionContract.ItemContract.ReadXmlValue(xmlReader, context);
         }
 
-        private bool[] GetRequiredMembers(ClassDataContract contract, out int firstRequiredMember)
+        private static bool[] GetRequiredMembers(ClassDataContract contract, out int firstRequiredMember)
         {
             int memberCount = contract.MemberNames!.Length;
             bool[] requiredMembers = new bool[memberCount];
@@ -139,7 +139,7 @@ namespace System.Runtime.Serialization
             return requiredMembers;
         }
 
-        private int GetRequiredMembers(ClassDataContract contract, bool[] requiredMembers)
+        private static int GetRequiredMembers(ClassDataContract contract, bool[] requiredMembers)
         {
             int memberCount = (contract.BaseClassContract == null) ? 0 : GetRequiredMembers(contract.BaseClassContract, requiredMembers);
             List<DataMember> members = contract.Members!;
index 2696c5d..c6ed9fc 100644 (file)
@@ -1259,7 +1259,7 @@ namespace System.Runtime.Serialization
             }
         }
 
-        private void ImportGenericInfo(XmlSchemaType type, DataContract dataContract)
+        private static void ImportGenericInfo(XmlSchemaType type, DataContract dataContract)
         {
             if (type.Annotation == null || type.Annotation.Items == null)
                 return;
@@ -1280,7 +1280,7 @@ namespace System.Runtime.Serialization
             }
         }
 
-        private GenericInfo ImportGenericInfo(XmlElement typeElement, XmlSchemaType type)
+        private static GenericInfo ImportGenericInfo(XmlElement typeElement, XmlSchemaType type)
         {
             string? name = typeElement.Attributes.GetNamedItem(Globals.GenericNameAttribute)?.Value;
             if (name == null)
index 0401f0e..d0ed281 100644 (file)
@@ -462,7 +462,7 @@ namespace System.Runtime.Serialization
                 return memberCount;
             }
 
-            private bool[] GetRequiredMembers(ClassDataContract contract, out int firstRequiredMember)
+            private static bool[] GetRequiredMembers(ClassDataContract contract, out int firstRequiredMember)
             {
                 int memberCount = contract.MemberNames!.Length;
                 bool[] requiredMembers = new bool[memberCount];
@@ -473,7 +473,7 @@ namespace System.Runtime.Serialization
                 return requiredMembers;
             }
 
-            private int GetRequiredMembers(ClassDataContract contract, bool[] requiredMembers)
+            private static int GetRequiredMembers(ClassDataContract contract, bool[] requiredMembers)
             {
                 int memberCount = (contract.BaseClassContract == null) ? 0 : GetRequiredMembers(contract.BaseClassContract, requiredMembers);
                 List<DataMember> members = contract.Members!;
index 5fdeb53..bfb18c9 100644 (file)
@@ -190,7 +190,7 @@ namespace System.Xml
             return XmlCharType.IsOnlyWhitespace(data);
         }
 
-        internal bool DecideXPNodeTypeForTextNodes(XmlNode node, ref XPathNodeType xnt)
+        internal static bool DecideXPNodeTypeForTextNodes(XmlNode node, ref XPathNodeType xnt)
         {
             //returns true - if all siblings of the node are processed else returns false.
             //The reference XPathNodeType argument being passed in is the watermark that
index ea5150a..94fb49e 100644 (file)
@@ -106,7 +106,7 @@ namespace System.Xml
             get
             {
                 XPathNodeType xnt = XPathNodeType.SignificantWhitespace;
-                DecideXPNodeTypeForTextNodes(this, ref xnt);
+                XmlCharacterData.DecideXPNodeTypeForTextNodes(this, ref xnt);
                 return xnt;
             }
         }
index 3d99438..51b6916 100644 (file)
@@ -832,7 +832,7 @@ namespace System.Xml.Schema
 
             XmlSchema schemaToUpdate = redefineEntry.schemaToUpdate;
             ArrayList includesOfRedefine = new ArrayList();
-            GetIncludedSet(originalSchema, includesOfRedefine);
+            Preprocessor.GetIncludedSet(originalSchema, includesOfRedefine);
             string targetNS = schemaToUpdate.TargetNamespace ?? string.Empty;
 
             XmlSchemaObjectCollection items = redefine.Items;
@@ -951,7 +951,7 @@ namespace System.Xml.Schema
             }
         }
 
-        private void GetIncludedSet(XmlSchema schema, ArrayList includesList)
+        private static void GetIncludedSet(XmlSchema schema, ArrayList includesList)
         {
             if (includesList.Contains(schema))
             {
index 71af70d..48ff221 100644 (file)
@@ -1608,14 +1608,14 @@ namespace System.Xml.Schema
             return -1;
         }
 
-        private bool IsParticleEmptiable(XmlSchemaParticle particle)
+        private static bool IsParticleEmptiable(XmlSchemaParticle particle)
         {
             decimal minOccurs;
             CalculateEffectiveTotalRange(particle, out minOccurs, out _);
             return minOccurs == decimal.Zero;
         }
 
-        private void CalculateEffectiveTotalRange(XmlSchemaParticle particle, out decimal minOccurs, out decimal maxOccurs)
+        private static void CalculateEffectiveTotalRange(XmlSchemaParticle particle, out decimal minOccurs, out decimal maxOccurs)
         {
             if (particle is XmlSchemaElement || particle is XmlSchemaAny)
             {
@@ -2423,14 +2423,14 @@ namespace System.Xml.Schema
         }
 
 #if DEBUG
-        private string DumpContentModel(XmlSchemaParticle particle)
+        private static string DumpContentModel(XmlSchemaParticle particle)
         {
             StringBuilder sb = new StringBuilder();
             DumpContentModelTo(sb, particle);
             return sb.ToString();
         }
 
-        private void DumpContentModelTo(StringBuilder sb, XmlSchemaParticle particle)
+        private static void DumpContentModelTo(StringBuilder sb, XmlSchemaParticle particle)
         {
             if (particle is XmlSchemaElement)
             {
@@ -2512,7 +2512,7 @@ namespace System.Xml.Schema
         }
 #endif
 
-        private void BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
+        private static void BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
         {
             if (particle is XmlSchemaElement element)
             {
index f4b835c..b3c670f 100644 (file)
@@ -51,7 +51,7 @@ namespace System.Xml.Schema
             _schema = schema;
             _xmlns = NameTable.Add("xmlns");
 
-            Cleanup(schema);
+            SchemaCollectionPreprocessor.Cleanup(schema);
             if (loadExternals && _xmlResolver != null)
             {
                 _schemaLocations = new Hashtable(); //new Dictionary<Uri, Uri>();
@@ -80,7 +80,7 @@ namespace System.Xml.Schema
             return !HasErrors;
         }
 
-        private void Cleanup(XmlSchema schema)
+        private static void Cleanup(XmlSchema schema)
         {
             if (schema.IsProcessing)
             {
index 0204922..9ede49c 100644 (file)
@@ -292,7 +292,7 @@ namespace System.Xml.Schema
             return !HasErrors;
         }
 
-        private void CleanupAttribute(XmlSchemaAttribute attribute)
+        private static void CleanupAttribute(XmlSchemaAttribute attribute)
         {
             if (attribute.SchemaType != null)
             {
@@ -301,7 +301,7 @@ namespace System.Xml.Schema
             attribute.AttDef = null;
         }
 
-        private void CleanupAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
+        private static void CleanupAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
         {
             CleanupAttributes(attributeGroup.Attributes);
             attributeGroup.AttributeUses.Clear();
@@ -369,7 +369,7 @@ namespace System.Xml.Schema
             }
         }
 
-        private void CleanupSimpleType(XmlSchemaSimpleType simpleType)
+        private static void CleanupSimpleType(XmlSchemaSimpleType simpleType)
         {
             if (simpleType == XmlSchemaType.GetBuiltInSimpleType(simpleType.TypeCode))
             { //If it is a built-in simple type dont clean up
@@ -405,7 +405,7 @@ namespace System.Xml.Schema
             element.IsLocalTypeDerivationChecked = false; //clear Local element type derivation check
         }
 
-        private void CleanupAttributes(XmlSchemaObjectCollection attributes)
+        private static void CleanupAttributes(XmlSchemaObjectCollection attributes)
         {
             for (int i = 0; i < attributes.Count; ++i)
             {
@@ -1958,14 +1958,14 @@ namespace System.Xml.Schema
             return -1;
         }
 
-        private bool IsParticleEmptiable(XmlSchemaParticle particle)
+        private static bool IsParticleEmptiable(XmlSchemaParticle particle)
         {
             decimal minOccurs;
             CalculateEffectiveTotalRange(particle, out minOccurs, out _);
             return minOccurs == decimal.Zero;
         }
 
-        private void CalculateEffectiveTotalRange(XmlSchemaParticle particle, out decimal minOccurs, out decimal maxOccurs)
+        private static void CalculateEffectiveTotalRange(XmlSchemaParticle particle, out decimal minOccurs, out decimal maxOccurs)
         {
             XmlSchemaChoice? choice = particle as XmlSchemaChoice;
 
@@ -2891,7 +2891,7 @@ namespace System.Xml.Schema
             }
         }
 
-        private bool BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
+        private static bool BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
         {
             bool hasWildCard = false;
             if (particle is XmlSchemaElement element)
index fe2e510..03fe5bc 100644 (file)
@@ -518,7 +518,7 @@ namespace System.Xml.Schema
 
         internal ArrayList ImportedNamespaces => _importedNamespaces ??= new ArrayList();
 
-        internal void GetExternalSchemasList(IList extList, XmlSchema schema)
+        internal static void GetExternalSchemasList(IList extList, XmlSchema schema)
         {
             Debug.Assert(extList != null && schema != null);
             if (extList.Contains(schema))
index 39308b0..0012e4a 100644 (file)
@@ -1309,7 +1309,7 @@ namespace System.Xml.Schema
         {
             //Remove From ChameleonSchemas and schemaLocations cache
             List<XmlSchema> reprocessList = new List<XmlSchema>();
-            schema.GetExternalSchemasList(reprocessList, schema);
+            XmlSchema.GetExternalSchemasList(reprocessList, schema);
             for (int i = 0; i < reprocessList.Count; ++i)
             { //Remove schema from schemaLocations & chameleonSchemas tables
                 if (reprocessList[i].BaseUri != null && reprocessList[i].BaseUri!.OriginalString.Length != 0)
index 6e5478a..dcb937e 100644 (file)
@@ -317,7 +317,7 @@ namespace System.Xml.Serialization
             {
                 foreach (Type t in scope.Types)
                 {
-                    compiler.AddImport(t, importedTypes);
+                    Compiler.AddImport(t, importedTypes);
                     Assembly a = t.Assembly;
                     string name = a.FullName!;
                     if (assemblies[name] != null)
@@ -331,7 +331,7 @@ namespace System.Xml.Serialization
 
             for (int i = 0; i < types.Length; i++)
             {
-                compiler.AddImport(types[i], importedTypes);
+                Compiler.AddImport(types[i], importedTypes);
             }
 
             var writer = new IndentedWriter(compiler.Source, false);
index d4994f6..c520afc 100644 (file)
@@ -21,7 +21,7 @@ namespace System.Xml.Serialization
         // SxS: This method does not take any resource name and does not expose any resources to the caller.
         // It's OK to suppress the SxS warning.
         [RequiresUnreferencedCode("Reflects against input Type DeclaringType")]
-        internal void AddImport(Type? type, Hashtable types)
+        internal static void AddImport(Type? type, Hashtable types)
         {
             if (type == null)
                 return;
index 1bf2e8d..a9cd3d1 100644 (file)
@@ -200,7 +200,7 @@ namespace System.Xml.Serialization
             return model;
         }
 
-        private void CheckSupportedMember(TypeDesc? typeDesc, MemberInfo member, Type type)
+        private static void CheckSupportedMember(TypeDesc? typeDesc, MemberInfo member, Type type)
         {
             if (typeDesc == null)
                 return;
index d8e862b..82bc9c1 100644 (file)
@@ -4920,7 +4920,7 @@ namespace System.Xml.Xsl.IlGen
         /// Returns true if the specified QilExpression node type is *guaranteed* to cache its results in an XmlQuerySequence,
         /// where items in the cache are stored using the default storage type.
         /// </summary>
-        private bool CachesResult(QilNode nd)
+        private static bool CachesResult(QilNode nd)
         {
             OptimizerPatterns patt;
 
index f68b1aa..50ab46a 100644 (file)
@@ -262,7 +262,7 @@ namespace System.Xml.Xsl.Xslt
             }
         }
 
-        private void FillModeFlags(Dictionary<QilName, XslFlags> parentModeFlags, Stylesheet sheet)
+        private static void FillModeFlags(Dictionary<QilName, XslFlags> parentModeFlags, Stylesheet sheet)
         {
             // Recursion: Process all imports to calculate ModeFlags for apply-import in this sheet
             foreach (Stylesheet import in sheet.Imports!)
index a7a87bf..af3e7f0 100644 (file)
@@ -390,7 +390,9 @@ namespace System
         }
 
         [Intrinsic]
+#pragma warning disable CA1822 // Mark members as static
         internal int GetElementSize() => GetElementSize();
+#pragma warning restore
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern CorElementType GetCorElementTypeOfElementTypeInternal(ObjectHandleOnStack arr);
index ceeb8fd..93c2251 100644 (file)
@@ -2091,7 +2091,7 @@ namespace Mono.Options
             return commands;
         }
 
-        private void AddNestedCommands(List<KeyValuePair<string, Command>> commands, string outer, CommandSet value)
+        private static void AddNestedCommands(List<KeyValuePair<string, Command>> commands, string outer, CommandSet value)
         {
             foreach (var v in value)
             {