未验证 提交 bf9ce639 编写于 作者: D dotnet-maestro[bot] 提交者: GitHub

[main] Update dependencies from dotnet/roslyn-analyzers (#86793)

* 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: Ndotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: NBuyaa Namnan <bunamnan@microsoft.com>
上级 37566167
......@@ -356,13 +356,13 @@
<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>
......
......@@ -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.
......
......@@ -243,7 +243,7 @@ public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, Pr
}
// 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)
{
......
......@@ -152,7 +152,7 @@ private string LastResortToString
// 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))
{
......
......@@ -308,7 +308,7 @@ private static RuntimeTypeInfo TypeDefInfoProjectionForArrays
//
// 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);
......
......@@ -161,7 +161,7 @@ internal static MethodNameAndSignature GetMethodNameAndSignature(ref NativeParse
#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 @@ private static uint GetGenericArgCountFromSig(NativeParser parser)
}
}
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 @@ private bool CompareMethodSigs(NativeParser parser1, NativeFormatModuleInfo modu
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.
......
......@@ -46,7 +46,7 @@ private static DefType[] ComputeRuntimeInterfacesForInstantiatedType(Instantiate
/// <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 @@ private DefType[] ComputeRuntimeInterfacesForNonInstantiatedMetadataType(Metadat
/// <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;
......
......@@ -1298,7 +1298,7 @@ public override IEnumerable<ILSequencePoint> GetSequencePointsForMethod(int meth
//
// 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));
......
......@@ -1359,7 +1359,7 @@ private static IEnumerable<MethodDesc> EnumVirtualSlotsDeclaredOnType(TypeDesc d
/// 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;
......
......@@ -321,7 +321,7 @@ public IEnumerable<P> ComputeVerticesInvolvedInAFlaggedCycle()
/// <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;
......
......@@ -24,12 +24,12 @@ private sealed partial class GraphBuilder
/// 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)
{
......
......@@ -298,7 +298,7 @@ private static bool TryGetPrimitiveComTypeViaConversion(Type argumentType, out V
// 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 @@ private VarEnum GetComType(ref Type argumentType)
/// 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
......
......@@ -765,7 +765,7 @@ protected override void OutputTypeNamePair(CodeTypeReference typeRef, string nam
OutputType(typeRef);
}
private string GetArrayPostfix(CodeTypeReference typeRef)
private static string GetArrayPostfix(CodeTypeReference typeRef)
{
string s = "";
if (typeRef.ArrayElementType != null)
......
......@@ -1421,7 +1421,7 @@ private ConfigXmlReader FindSection(string[] keys, SectionXmlInfo sectionXmlInfo
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;
......
......@@ -217,7 +217,7 @@ private void SaveAsImpl(string filename, ConfigurationSaveMode saveMode, bool fo
}
// 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)
{
......
......@@ -2368,7 +2368,7 @@ private static int UpdateIndent(int oldIndent, XmlUtil xmlUtil, XmlUtilWriter ut
}
}
private bool CopyConfigDeclarationsRecursive(
private static bool CopyConfigDeclarationsRecursive(
SectionUpdates declarationUpdates, XmlUtil xmlUtil, XmlUtilWriter utilWriter, string group,
int parentLinePosition, int parentIndent)
{
......
......@@ -3339,7 +3339,7 @@ internal bool ValidateLocaleConstraint()
}
// 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)
{
......
......@@ -2352,7 +2352,7 @@ private static DataTable IncrementalCloneTo(DataTable sourceTable, DataTable tar
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 @@ public void WriteXmlSchema(TextWriter? writer, bool writeHierarchy)
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 @@ internal void ReadXmlSchema(XmlReader? reader, bool denyResolving)
}
}
private void CreateTableList(DataTable currentTable, List<DataTable> tableList)
private static void CreateTableList(DataTable currentTable, List<DataTable> tableList)
{
foreach (DataRelation r in currentTable.ChildRelations)
{
......
......@@ -1164,7 +1164,7 @@ string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[]? listAc
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 @@ PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(
return new PropertyDescriptorCollection(null);
}
DataTable? foundTable = dataSet.FindTable(_table, listAccessors, 0);
DataTable? foundTable = DataSet.FindTable(_table, listAccessors, 0);
if (foundTable != null)
{
return foundTable.GetPropertyDescriptorCollection();
......
......@@ -270,7 +270,7 @@ string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[]? listAc
}
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 @@ PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(
}
else
{
DataTable? table = dataSet.FindTable(null, listAccessors, 0);
DataTable? table = DataSet.FindTable(null, listAccessors, 0);
if (table != null)
{
return table.GetPropertyDescriptorCollection();
......
......@@ -452,7 +452,7 @@ private void CreateIndex()
}
private bool IsOperatorIn(ExpressionNode? enode)
private static bool IsOperatorIn(ExpressionNode? enode)
{
BinaryNode? bnode = (enode as BinaryNode);
if (null != bnode)
......
......@@ -868,7 +868,7 @@ private void HandleRelations(XmlSchemaAnnotation ann, bool fNested)
}
}
internal XmlSchemaObjectCollection? GetParticleItems(XmlSchemaParticle? pt)
internal static XmlSchemaObjectCollection? GetParticleItems(XmlSchemaParticle? pt)
{
if (pt is XmlSchemaSequence)
return ((XmlSchemaSequence)pt).Items;
......
......@@ -60,7 +60,7 @@ protected override Expression VisitMethodCall(MethodCallExpression m)
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 @@ private ReadOnlyCollection<Expression> FixupQuotedArgs(MethodInfo mi, ReadOnlyCo
return argList;
}
private Expression FixupQuotedExpression(Type type, Expression expression)
private static Expression FixupQuotedExpression(Type type, Expression expression)
{
Expression expr = expression;
while (true)
......
......@@ -573,7 +573,7 @@ static int CountNullabilityStates(Type type)
}
}
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)
......
......@@ -419,7 +419,7 @@ private void LoadArray(byte[] array)
_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);
......
......@@ -127,7 +127,7 @@ protected static bool ReflectionTryWritePrimitive(XmlWriterDelegator xmlWriter,
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 @@ private void InvokeOnSerializing(object obj, XmlObjectSerializerWriteContext con
}
}
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);
......
......@@ -208,7 +208,7 @@ protected virtual bool ReflectionReadSpecialCollection(XmlReaderDelegator xmlRea
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 @@ private static void ReflectionSetMemberValue(ref object obj, object? memberValue
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 @@ private void InvokeOnDeserializing(XmlObjectSerializerReadContext context, Class
}
}
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);
......
......@@ -128,7 +128,7 @@ protected override string GetCollectionContractNamespace(CollectionDataContract
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 @@ private bool[] GetRequiredMembers(ClassDataContract contract, out int firstRequi
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!;
......
......@@ -1259,7 +1259,7 @@ private void ImportDataContractExtension(XmlSchemaType type, DataContract dataCo
}
}
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 @@ private void ImportGenericInfo(XmlSchemaType type, DataContract dataContract)
}
}
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)
......
......@@ -462,7 +462,7 @@ private int ReadMembers(ClassDataContract classContract, bool[] requiredMembers,
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 @@ private bool[] GetRequiredMembers(ClassDataContract contract, out int firstRequi
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!;
......
......@@ -190,7 +190,7 @@ internal static bool CheckOnData(string? data)
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
......
......@@ -106,7 +106,7 @@ internal override XPathNodeType XPNodeType
get
{
XPathNodeType xnt = XPathNodeType.SignificantWhitespace;
DecideXPNodeTypeForTextNodes(this, ref xnt);
XmlCharacterData.DecideXPNodeTypeForTextNodes(this, ref xnt);
return xnt;
}
}
......
......@@ -832,7 +832,7 @@ private void PreprocessRedefine(RedefineEntry redefineEntry)
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 @@ private void PreprocessRedefine(RedefineEntry redefineEntry)
}
}
private void GetIncludedSet(XmlSchema schema, ArrayList includesList)
private static void GetIncludedSet(XmlSchema schema, ArrayList includesList)
{
if (includesList.Contains(schema))
{
......
......@@ -1608,14 +1608,14 @@ private int GetMappingParticle(XmlSchemaParticle particle, XmlSchemaObjectCollec
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 @@ private ContentValidator CompileComplexContent(XmlSchemaComplexType complexType)
}
#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 @@ private void DumpContentModelTo(StringBuilder sb, XmlSchemaParticle particle)
}
#endif
private void BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
private static void BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
{
if (particle is XmlSchemaElement element)
{
......
......@@ -51,7 +51,7 @@ public bool Execute(XmlSchema schema, string? targetNamespace, bool loadExternal
_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 @@ public bool Execute(XmlSchema schema, string? targetNamespace, bool loadExternal
return !HasErrors;
}
private void Cleanup(XmlSchema schema)
private static void Cleanup(XmlSchema schema)
{
if (schema.IsProcessing)
{
......
......@@ -292,7 +292,7 @@ internal bool Compile()
return !HasErrors;
}
private void CleanupAttribute(XmlSchemaAttribute attribute)
private static void CleanupAttribute(XmlSchemaAttribute attribute)
{
if (attribute.SchemaType != null)
{
......@@ -301,7 +301,7 @@ private void CleanupAttribute(XmlSchemaAttribute attribute)
attribute.AttDef = null;
}
private void CleanupAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
private static void CleanupAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
{
CleanupAttributes(attributeGroup.Attributes);
attributeGroup.AttributeUses.Clear();
......@@ -369,7 +369,7 @@ private void CleanupComplexType(XmlSchemaComplexType complexType)
}
}
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 @@ private void CleanupElement(XmlSchemaElement element)
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 @@ private int GetMappingParticle(XmlSchemaParticle particle, XmlSchemaObjectCollec
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 @@ private ContentValidator CompileComplexContent(XmlSchemaComplexType complexType)
}
}
private bool BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
private static bool BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
{
bool hasWildCard = false;
if (particle is XmlSchemaElement element)
......
......@@ -518,7 +518,7 @@ internal override void AddAnnotation(XmlSchemaAnnotation annotation)
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))
......
......@@ -1309,7 +1309,7 @@ private void RemoveSchemaFromCaches(XmlSchema 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)
......
......@@ -317,7 +317,7 @@ internal static bool GenerateSerializerToStream(XmlMapping[] xmlMappings, Type?[
{
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 @@ internal static bool GenerateSerializerToStream(XmlMapping[] xmlMappings, Type?[
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);
......
......@@ -21,7 +21,7 @@ internal sealed class Compiler
// 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;
......
......@@ -200,7 +200,7 @@ internal MemberInfo[] GetMemberInfos()
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;
......
......@@ -4920,7 +4920,7 @@ private void NestedVisitEnsureCache(QilNode nd, Type itemStorageType)
/// 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;
......
......@@ -262,7 +262,7 @@ private void AddImportDependencies(Stylesheet sheet, Template focusDonor)
}
}
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!)
......
......@@ -390,7 +390,9 @@ public int GetLowerBound(int dimension)
}
[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);
......
......@@ -2091,7 +2091,7 @@ public override int Invoke(IEnumerable<string> arguments)
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)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册