Browse Source

Fixed some FxCop warnings.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
fe8e098a27
  1. 4
      ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs
  2. 2
      ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs
  3. 2
      ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs
  4. 4
      ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs
  5. 6
      ICSharpCode.NRefactory.CSharp/TypeSystem/ConstantValues.cs
  6. 2
      ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs
  7. 4
      ICSharpCode.NRefactory.VB/Ast/AstNode.cs
  8. 6
      ICSharpCode.NRefactory/Completion/CompletionCategory.cs
  9. 6
      ICSharpCode.NRefactory/Documentation/DocumentationComment.cs
  10. 2
      ICSharpCode.NRefactory/Documentation/IdStringProvider.cs
  11. 2
      ICSharpCode.NRefactory/Documentation/XmlDocumentationProvider.cs
  12. 1
      ICSharpCode.NRefactory/Editor/ITextSource.cs
  13. 19
      ICSharpCode.NRefactory/IAnnotatable.cs
  14. 3
      ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj
  15. 12
      ICSharpCode.NRefactory/Semantics/ArrayAccessResolveResult.cs
  16. 6
      ICSharpCode.NRefactory/Semantics/ArrayCreateResolveResult.cs
  17. 3
      ICSharpCode.NRefactory/Semantics/ByReferenceResolveResult.cs
  18. 3
      ICSharpCode.NRefactory/Semantics/ConstantResolveResult.cs
  19. 4
      ICSharpCode.NRefactory/Semantics/InvocationResolveResult.cs
  20. 3
      ICSharpCode.NRefactory/Semantics/LocalResolveResult.cs
  21. 4
      ICSharpCode.NRefactory/Semantics/MemberResolveResult.cs
  22. 3
      ICSharpCode.NRefactory/Semantics/NamespaceResolveResult.cs
  23. 2
      ICSharpCode.NRefactory/Semantics/ResolveResult.cs
  24. 5
      ICSharpCode.NRefactory/Semantics/UnknownMemberResolveResult.cs
  25. 22
      ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs
  26. 4
      ICSharpCode.NRefactory/TypeSystem/ComHelper.cs
  27. 8
      ICSharpCode.NRefactory/TypeSystem/IAmbience.cs
  28. 10
      ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractResolvedTypeParameter.cs
  29. 2
      ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractUnresolvedEntity.cs
  30. 2
      ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractUnresolvedMember.cs
  31. 4
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultAssemblyReference.cs
  32. 18
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultParameter.cs
  33. 2
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs
  34. 6
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedParameter.cs
  35. 11
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedTypeDefinition.cs
  36. 10
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedTypeParameter.cs
  37. 27
      ICSharpCode.NRefactory/TypeSystem/Implementation/FullNameAndTypeParameterCount.cs
  38. 2
      ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs
  39. 4
      ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs
  40. 2
      ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleConstantValue.cs
  41. 5
      ICSharpCode.NRefactory/TypeSystem/Implementation/TypeParameterReference.cs
  42. 2
      ICSharpCode.NRefactory/TypeSystem/InheritanceHelper.cs
  43. 3
      ICSharpCode.NRefactory/Utils/BitVector16.cs
  44. 5
      ICSharpCode.NRefactory/Utils/BusyManager.cs
  45. 14
      ICSharpCode.NRefactory/Utils/CacheManager.cs
  46. 4
      ICSharpCode.NRefactory/Utils/EmptyList.cs
  47. 8
      ICSharpCode.NRefactory/Utils/FastSerializer.cs
  48. 2
      ICSharpCode.NRefactory/Utils/LazyInit.cs
  49. 4
      ICSharpCode.NRefactory/Utils/ReferenceComparer.cs

4
ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs

@ -471,9 +471,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -471,9 +471,7 @@ namespace ICSharpCode.NRefactory.CSharp
}
// Finally, clone the annotation, if necessary
ICloneable copiedAnnotations = copy.annotations as ICloneable; // read from copy (for thread-safety)
if (copiedAnnotations != null)
copy.annotations = copiedAnnotations.Clone();
copy.CloneAnnotations();
return copy;
}

2
ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs

@ -704,7 +704,6 @@ namespace ICSharpCode.NRefactory.CSharp @@ -704,7 +704,6 @@ namespace ICSharpCode.NRefactory.CSharp
}
FormatCommas (constructorDeclaration, policy.SpaceBeforeConstructorDeclarationParameterComma, policy.SpaceAfterConstructorDeclarationParameterComma);
object result = null;
if (!constructorDeclaration.Body.IsNull) {
EnforceBraceStyle (policy.ConstructorBraceStyle, constructorDeclaration.Body.LBraceToken, constructorDeclaration.Body.RBraceToken);
if (policy.IndentMethodBody)
@ -725,7 +724,6 @@ namespace ICSharpCode.NRefactory.CSharp @@ -725,7 +724,6 @@ namespace ICSharpCode.NRefactory.CSharp
int offset = this.document.GetOffset (lParen.StartLocation);
ForceSpaceBefore (offset, policy.SpaceBeforeConstructorDeclarationParentheses);
object result = null;
if (!destructorDeclaration.Body.IsNull) {
EnforceBraceStyle (policy.DestructorBraceStyle, destructorDeclaration.Body.LBraceToken, destructorDeclaration.Body.RBraceToken);
if (policy.IndentMethodBody)

2
ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs

@ -55,7 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -55,7 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp
EntityDeclaration node = astBuilder.ConvertEntity(entity);
PrintModifiers(node.Modifiers, formatter);
if ((ConversionFlags & ConversionFlags.ShowDefinitionKeyWord) == ConversionFlags.ShowDefinitionKeyWord) {
if ((ConversionFlags & ConversionFlags.ShowDefinitionKeyword) == ConversionFlags.ShowDefinitionKeyword) {
if (node is TypeDeclaration) {
switch (((TypeDeclaration)node).ClassType) {
case ClassType.Class:

4
ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs

@ -473,7 +473,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver @@ -473,7 +473,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver
while (!resolverBeforeDict.TryGetValue(parent, out storedResolver)) {
parent = parent.Parent;
if (parent == null)
throw new InvalidOperationException("Could not find a resolver state for any parent of the specified node. Did you forget to call 'Scan(compilationUnit);'?");
throw new InvalidOperationException("Could not find a resolver state for any parent of the specified node. Are you trying to resolve a node that is not a descendant of the CSharpAstResolver's root node?");
}
return storedResolver;
}
@ -1255,7 +1255,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver @@ -1255,7 +1255,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver
ResolveResult rr = resolver.ResolveIndexer(targetResult, arguments, argumentNames);
ArrayAccessResolveResult aarr = rr as ArrayAccessResolveResult;
if (aarr != null) {
ProcessConversionResults(indexerExpression.Arguments, aarr.Indices);
ProcessConversionResults(indexerExpression.Arguments, aarr.Indexes);
} else {
ProcessConversionsInInvocation(target, indexerExpression.Arguments, rr as CSharpInvocationResolveResult);
}

6
ICSharpCode.NRefactory.CSharp/TypeSystem/ConstantValues.cs

@ -89,12 +89,12 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem.ConstantValues @@ -89,12 +89,12 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem.ConstantValues
}
}
static ResolveResult[] MapToNewContext(ResolveResult[] input, ITypeResolveContext newContext)
static ResolveResult[] MapToNewContext(IList<ResolveResult> input, ITypeResolveContext newContext)
{
if (input == null)
return null;
ResolveResult[] output = new ResolveResult[input.Length];
for (int i = 0; i < input.Length; i++) {
ResolveResult[] output = new ResolveResult[input.Count];
for (int i = 0; i < output.Length; i++) {
output[i] = MapToNewContext(input[i], newContext);
}
return output;

2
ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs

@ -613,7 +613,7 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -613,7 +613,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
{
ITypeDefinition type = GetTypeDefinition(typeof(ParamsAttribute));
var arr = (ArrayCreateResolveResult)type.Attributes.Single().PositionalArguments.Single();
Assert.AreEqual(5, arr.InitializerElements.Length);
Assert.AreEqual(5, arr.InitializerElements.Count);
return arr.InitializerElements[index];
}

4
ICSharpCode.NRefactory.VB/Ast/AstNode.cs

@ -413,9 +413,7 @@ namespace ICSharpCode.NRefactory.VB @@ -413,9 +413,7 @@ namespace ICSharpCode.NRefactory.VB
}
// Finally, clone the annotation, if necessary
ICloneable annotations = copy.annotations as ICloneable; // read from copy (for thread-safety)
if (annotations != null)
copy.annotations = annotations.Clone();
copy.CloneAnnotations();
return copy;
}

6
ICSharpCode.NRefactory/Completion/CompletionCategory.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
//
//
// CompletionCategory.cs
//
// Author:
@ -33,11 +33,11 @@ namespace ICSharpCode.NRefactory.Completion @@ -33,11 +33,11 @@ namespace ICSharpCode.NRefactory.Completion
public string Icon { get; set; }
public CompletionCategory ()
protected CompletionCategory ()
{
}
public CompletionCategory (string displayText, string icon)
protected CompletionCategory (string displayText, string icon)
{
this.DisplayText = displayText;
this.Icon = icon;

6
ICSharpCode.NRefactory/Documentation/DocumentationComment.cs

@ -85,10 +85,10 @@ namespace ICSharpCode.NRefactory.Documentation @@ -85,10 +85,10 @@ namespace ICSharpCode.NRefactory.Documentation
return Xml.Text;
}
public static implicit operator string (DocumentationComment cmt)
public static implicit operator string (DocumentationComment documentationComment)
{
if (cmt != null)
return cmt.ToString ();
if (documentationComment != null)
return documentationComment.ToString ();
return null;
}
}

2
ICSharpCode.NRefactory/Documentation/IdStringProvider.cs

@ -187,7 +187,7 @@ namespace ICSharpCode.NRefactory.Documentation @@ -187,7 +187,7 @@ namespace ICSharpCode.NRefactory.Documentation
public static IMemberReference ParseMemberIdString(string memberIdString)
{
if (memberIdString == null)
throw new ArgumentNullException("memberIDString");
throw new ArgumentNullException("memberIdString");
if (memberIdString.Length < 2 || memberIdString[1] != ':')
throw new ReflectionNameParseException(0, "Missing type tag");
char typeChar = memberIdString[0];

2
ICSharpCode.NRefactory/Documentation/XmlDocumentationProvider.cs

@ -242,7 +242,7 @@ namespace ICSharpCode.NRefactory.Documentation @@ -242,7 +242,7 @@ namespace ICSharpCode.NRefactory.Documentation
}
}
void ReadMembersSection(XmlTextReader reader, LinePositionMapper linePosMapper, List<IndexEntry> indexList)
static void ReadMembersSection(XmlTextReader reader, LinePositionMapper linePosMapper, List<IndexEntry> indexList)
{
while (reader.Read()) {
switch (reader.NodeType) {

1
ICSharpCode.NRefactory/Editor/ITextSource.cs

@ -67,6 +67,7 @@ namespace ICSharpCode.NRefactory.Editor @@ -67,6 +67,7 @@ namespace ICSharpCode.NRefactory.Editor
/// <summary>
/// Gets the whole text as string.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")]
string Text { get; }
/// <summary>

19
ICSharpCode.NRefactory/IAnnotatable.cs

@ -85,9 +85,22 @@ namespace ICSharpCode.NRefactory @@ -85,9 +85,22 @@ namespace ICSharpCode.NRefactory
// or to an AnnotationList.
// Once it is pointed at an AnnotationList, it will never change (this allows thread-safety support by locking the list)
[CLSCompliant(false)]
[NonSerialized]
protected object annotations;
object annotations;
/// <summary>
/// Clones all annotations.
/// This method is intended to be called by Clone() implementations in derived classes.
/// <code>
/// AstNode copy = (AstNode)MemberwiseClone();
/// copy.CloneAnnotations();
/// </code>
/// </summary>
protected void CloneAnnotations()
{
ICloneable cloneable = annotations as ICloneable;
if (cloneable != null)
annotations = cloneable.Clone();
}
sealed class AnnotationList : List<object>, ICloneable
{

3
ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
<NoStdLib>False</NoStdLib>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunCodeAnalysis>False</RunCodeAnalysis>
<CodeAnalysisRules>-Microsoft.Design#CA1026;-Microsoft.Security#CA2104</CodeAnalysisRules>
<CodeAnalysisRules>-Microsoft.Design#CA1000;-Microsoft.Design#CA1004;-Microsoft.Design#CA1005;-Microsoft.Design#CA1006;-Microsoft.Design#CA1026;-Microsoft.Design#CA1033;-Microsoft.Design#CA1051;-Microsoft.Design#CA1063;-Microsoft.Naming#CA1702;-Microsoft.Naming#CA1704;-Microsoft.Naming#CA1710;-Microsoft.Naming#CA1716;-Microsoft.Naming#CA1720;-Microsoft.Performance#CA1800;-Microsoft.Security#CA2104</CodeAnalysisRules>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<StartAction>Project</StartAction>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>

12
ICSharpCode.NRefactory/Semantics/ArrayAccessResolveResult.cs

@ -30,21 +30,21 @@ namespace ICSharpCode.NRefactory.Semantics @@ -30,21 +30,21 @@ namespace ICSharpCode.NRefactory.Semantics
public class ArrayAccessResolveResult : ResolveResult
{
public readonly ResolveResult Array;
public readonly ResolveResult[] Indices;
public readonly IList<ResolveResult> Indexes;
public ArrayAccessResolveResult(IType elementType, ResolveResult array, ResolveResult[] indices) : base(elementType)
public ArrayAccessResolveResult(IType elementType, ResolveResult array, IList<ResolveResult> indexes) : base(elementType)
{
if (array == null)
throw new ArgumentNullException("array");
if (indices == null)
throw new ArgumentNullException("indices");
if (indexes == null)
throw new ArgumentNullException("indexes");
this.Array = array;
this.Indices = indices;
this.Indexes = indexes;
}
public override IEnumerable<ResolveResult> GetChildResults()
{
return new [] { Array }.Concat(Indices);
return new [] { Array }.Concat(Indexes);
}
}
}

6
ICSharpCode.NRefactory/Semantics/ArrayCreateResolveResult.cs

@ -32,15 +32,15 @@ namespace ICSharpCode.NRefactory.Semantics @@ -32,15 +32,15 @@ namespace ICSharpCode.NRefactory.Semantics
/// <summary>
/// Gets the size arguments.
/// </summary>
public readonly ResolveResult[] SizeArguments;
public readonly IList<ResolveResult> SizeArguments;
/// <summary>
/// Gets the initializer elements.
/// This field may be null if no initializer was specified.
/// </summary>
public readonly ResolveResult[] InitializerElements;
public readonly IList<ResolveResult> InitializerElements;
public ArrayCreateResolveResult(IType arrayType, ResolveResult[] sizeArguments, ResolveResult[] initializerElements)
public ArrayCreateResolveResult(IType arrayType, IList<ResolveResult> sizeArguments, IList<ResolveResult> initializerElements)
: base(arrayType)
{
this.SizeArguments = sizeArguments;

3
ICSharpCode.NRefactory/Semantics/ByReferenceResolveResult.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using ICSharpCode.NRefactory.TypeSystem;
@ -59,7 +60,7 @@ namespace ICSharpCode.NRefactory.Semantics @@ -59,7 +60,7 @@ namespace ICSharpCode.NRefactory.Semantics
public override string ToString()
{
return string.Format("[{0} {1} {2}]", GetType().Name, IsOut ? "out" : "ref", ElementType);
return string.Format(CultureInfo.InvariantCulture, "[{0} {1} {2}]", GetType().Name, IsOut ? "out" : "ref", ElementType);
}
}
}

3
ICSharpCode.NRefactory/Semantics/ConstantResolveResult.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Globalization;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.Semantics
@ -43,7 +44,7 @@ namespace ICSharpCode.NRefactory.Semantics @@ -43,7 +44,7 @@ namespace ICSharpCode.NRefactory.Semantics
public override string ToString()
{
return string.Format("[{0} {1} = {2}]", GetType().Name, this.Type, constantValue);
return string.Format(CultureInfo.InvariantCulture, "[{0} {1} = {2}]", GetType().Name, this.Type, constantValue);
}
}
}

4
ICSharpCode.NRefactory/Semantics/InvocationResolveResult.cs

@ -35,7 +35,7 @@ namespace ICSharpCode.NRefactory.Semantics @@ -35,7 +35,7 @@ namespace ICSharpCode.NRefactory.Semantics
/// </summary>
public readonly IList<ResolveResult> Arguments;
public InvocationResolveResult(ResolveResult targetResult, IParameterizedMember member, IList<ResolveResult> arguments)
protected InvocationResolveResult(ResolveResult targetResult, IParameterizedMember member, IList<ResolveResult> arguments)
: base(targetResult, member)
{
this.Arguments = arguments ?? EmptyList<ResolveResult>.Instance;
@ -49,6 +49,8 @@ namespace ICSharpCode.NRefactory.Semantics @@ -49,6 +49,8 @@ namespace ICSharpCode.NRefactory.Semantics
/// Gets the arguments in the order they are being passed to the method.
/// For parameter arrays (params), this will return an ArrayCreateResolveResult.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
Justification = "Derived methods may be expensive and create new lists")]
public virtual IList<ResolveResult> GetArgumentsForCall()
{
return Arguments;

3
ICSharpCode.NRefactory/Semantics/LocalResolveResult.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Globalization;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.Semantics
@ -65,7 +66,7 @@ namespace ICSharpCode.NRefactory.Semantics @@ -65,7 +66,7 @@ namespace ICSharpCode.NRefactory.Semantics
public override string ToString()
{
return string.Format("[LocalResolveResult {0}]", variable);
return string.Format(CultureInfo.InvariantCulture, "[LocalResolveResult {0}]", variable);
}
public override DomRegion GetDefinitionRegion()

4
ICSharpCode.NRefactory/Semantics/MemberResolveResult.cs

@ -18,7 +18,9 @@ @@ -18,7 +18,9 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.Semantics
@ -85,7 +87,7 @@ namespace ICSharpCode.NRefactory.Semantics @@ -85,7 +87,7 @@ namespace ICSharpCode.NRefactory.Semantics
public override string ToString()
{
return string.Format("[{0} {1}]", GetType().Name, member);
return string.Format(CultureInfo.InvariantCulture, "[{0} {1}]", GetType().Name, member);
}
public override DomRegion GetDefinitionRegion()

3
ICSharpCode.NRefactory/Semantics/NamespaceResolveResult.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Globalization;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.Semantics
@ -43,7 +44,7 @@ namespace ICSharpCode.NRefactory.Semantics @@ -43,7 +44,7 @@ namespace ICSharpCode.NRefactory.Semantics
public override string ToString()
{
return string.Format("[{0} {1}]", GetType().Name, ns);
return string.Format(CultureInfo.InvariantCulture, "[{0} {1}]", GetType().Name, ns);
}
}
}

2
ICSharpCode.NRefactory/Semantics/ResolveResult.cs

@ -38,6 +38,8 @@ namespace ICSharpCode.NRefactory.Semantics @@ -38,6 +38,8 @@ namespace ICSharpCode.NRefactory.Semantics
this.type = type;
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods",
Justification = "Unrelated to object.GetType()")]
public IType Type {
get { return type; }
}

5
ICSharpCode.NRefactory/Semantics/UnknownMemberResolveResult.cs

@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using ICSharpCode.NRefactory.TypeSystem;
@ -64,7 +65,7 @@ namespace ICSharpCode.NRefactory.Semantics @@ -64,7 +65,7 @@ namespace ICSharpCode.NRefactory.Semantics
public override string ToString()
{
return string.Format("[{0} {1}.{2}]", GetType().Name, targetType, memberName);
return string.Format(CultureInfo.InvariantCulture, "[{0} {1}.{2}]", GetType().Name, targetType, memberName);
}
}
@ -115,7 +116,7 @@ namespace ICSharpCode.NRefactory.Semantics @@ -115,7 +116,7 @@ namespace ICSharpCode.NRefactory.Semantics
public override string ToString()
{
return string.Format("[{0} {1}]", GetType().Name, identifier);
return string.Format(CultureInfo.InvariantCulture, "[{0} {1}]", GetType().Name, identifier);
}
}
}

22
ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs

@ -424,7 +424,7 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -424,7 +424,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
static readonly ITypeReference methodImplAttributeTypeRef = typeof(MethodImplAttribute).ToTypeReference();
static readonly ITypeReference methodImplOptionsTypeRef = typeof(MethodImplOptions).ToTypeReference();
bool HasAnyAttributes(MethodDefinition methodDefinition)
static bool HasAnyAttributes(MethodDefinition methodDefinition)
{
if (methodDefinition.HasPInvokeInfo)
return true;
@ -891,10 +891,6 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -891,10 +891,6 @@ namespace ICSharpCode.NRefactory.TypeSystem
}
}
public ICompilation Compilation {
get { return context.Compilation; }
}
public override string ToString()
{
return "[" + attributeType.ToString() + "(...)]";
@ -1037,22 +1033,6 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -1037,22 +1033,6 @@ namespace ICSharpCode.NRefactory.TypeSystem
}
}
public int ReadCompressedInt32()
{
unchecked {
var value =(int)(ReadCompressedUInt32() >> 1);
if((value & 1) == 0)
return value;
if(value < 0x40)
return value - 0x40;
if(value < 0x2000)
return value - 0x2000;
if(value < 0x10000000)
return value - 0x10000000;
return value - 0x20000000;
}
}
public float ReadSingle()
{
unchecked {

4
ICSharpCode.NRefactory/TypeSystem/ComHelper.cs

@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
/// <summary>
/// Helper methods for COM.
/// </summary>
public class ComHelper
public static class ComHelper
{
static bool IsComAttribute(IAttribute attribute, string name)
{
@ -45,6 +45,8 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -45,6 +45,8 @@ namespace ICSharpCode.NRefactory.TypeSystem
/// <summary>
/// Gets the CoClass of the specified COM interface.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Co",
Justification = "Consistent with CoClassAttribute")]
public static IType GetCoClass(ITypeDefinition typeDefinition)
{
if (typeDefinition == null)

8
ICSharpCode.NRefactory/TypeSystem/IAmbience.cs

@ -42,7 +42,7 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -42,7 +42,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
/// <summary>
/// Show the definition key word (class, struct, Sub, Function, etc.)
/// </summary>
ShowDefinitionKeyWord = 8,
ShowDefinitionKeyword = 8,
/// <summary>
/// Show the declaring type for the member
/// </summary>
@ -76,17 +76,17 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -76,17 +76,17 @@ namespace ICSharpCode.NRefactory.TypeSystem
ShowReturnType |
ShowModifiers |
ShowTypeParameterList |
ShowDefinitionKeyWord |
ShowDefinitionKeyword |
ShowBody,
All = 0xfff,
All = 0x3ff,
}
public interface IAmbience
{
ConversionFlags ConversionFlags { get; set; }
string ConvertEntity(IEntity e);
string ConvertEntity(IEntity entity);
string ConvertType(IType type);
string ConvertVariable(IVariable variable);

10
ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractResolvedTypeParameter.cs

@ -18,8 +18,8 @@ @@ -18,8 +18,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Globalization;
using ICSharpCode.NRefactory.Utils;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
@ -43,7 +43,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -43,7 +43,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
this.compilation = owner.Compilation;
this.ownerType = owner.EntityType;
this.index = index;
this.name = name ?? ((this.OwnerType == EntityType.Method ? "!!" : "!") + index.ToString());
this.name = name ?? ((this.OwnerType == EntityType.Method ? "!!" : "!") + index.ToString(CultureInfo.InvariantCulture));
this.attributes = attributes ?? EmptyList<IAttribute>.Instance;
this.region = region;
this.variance = variance;
@ -56,7 +56,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -56,7 +56,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
this.compilation = compilation;
this.ownerType = ownerType;
this.index = index;
this.name = name ?? ((this.OwnerType == EntityType.Method ? "!!" : "!") + index.ToString());
this.name = name ?? ((this.OwnerType == EntityType.Method ? "!!" : "!") + index.ToString(CultureInfo.InvariantCulture));
this.attributes = attributes ?? EmptyList<IAttribute>.Instance;
this.region = region;
this.variance = variance;
@ -198,7 +198,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -198,7 +198,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
public string ReflectionName {
get {
return (this.OwnerType == EntityType.Method ? "``" : "`") + index.ToString();
return (this.OwnerType == EntityType.Method ? "``" : "`") + index.ToString(CultureInfo.InvariantCulture);
}
}

2
ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractUnresolvedEntity.cs

@ -174,7 +174,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -174,7 +174,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return name; }
set {
if (value == null)
throw new ArgumentNullException();
throw new ArgumentNullException("value");
ThrowIfFrozen();
name = value;
}

2
ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractUnresolvedMember.cs

@ -68,7 +68,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -68,7 +68,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return returnType; }
set {
if (value == null)
throw new ArgumentNullException();
throw new ArgumentNullException("value");
ThrowIfFrozen();
returnType = value;
}

4
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultAssemblyReference.cs

@ -26,8 +26,8 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -26,8 +26,8 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
[Serializable]
public sealed class DefaultAssemblyReference : IAssemblyReference, ISupportsInterning
{
public static IAssemblyReference CurrentAssembly = new CurrentAssemblyReference();
public static IAssemblyReference Corlib = new DefaultAssemblyReference("mscorlib");
public static readonly IAssemblyReference CurrentAssembly = new CurrentAssemblyReference();
public static readonly IAssemblyReference Corlib = new DefaultAssemblyReference("mscorlib");
string shortName;

18
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultParameter.cs

@ -107,22 +107,22 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -107,22 +107,22 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
return ToString(this);
}
public static string ToString(IParameter p)
public static string ToString(IParameter parameter)
{
StringBuilder b = new StringBuilder();
if (p.IsRef)
if (parameter.IsRef)
b.Append("ref ");
if (p.IsOut)
if (parameter.IsOut)
b.Append("out ");
if (p.IsParams)
if (parameter.IsParams)
b.Append("params ");
b.Append(p.Name);
b.Append(parameter.Name);
b.Append(':');
b.Append(p.Type.ToString());
if (p.IsOptional) {
b.Append(parameter.Type.ToString());
if (parameter.IsOptional) {
b.Append(" = ");
if (p.ConstantValue != null)
b.Append(p.ConstantValue.ToString());
if (parameter.ConstantValue != null)
b.Append(parameter.ConstantValue.ToString());
else
b.Append("null");
}

2
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs

@ -61,7 +61,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -61,7 +61,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return assemblyName; }
set {
if (value == null)
throw new ArgumentNullException();
throw new ArgumentNullException("value");
FreezableHelper.ThrowIfFrozen(this);
assemblyName = value;
}

6
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedParameter.cs

@ -18,8 +18,8 @@ @@ -18,8 +18,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Text;
using ICSharpCode.NRefactory.Semantics;
using ICSharpCode.NRefactory.Utils;
@ -62,7 +62,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -62,7 +62,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return name; }
set {
if (value == null)
throw new ArgumentNullException();
throw new ArgumentNullException("value");
FreezableHelper.ThrowIfFrozen(this);
name = value;
}
@ -72,7 +72,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -72,7 +72,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return type; }
set {
if (value == null)
throw new ArgumentNullException();
throw new ArgumentNullException("value");
FreezableHelper.ThrowIfFrozen(this);
type = value;
}

11
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedTypeDefinition.cs

@ -17,8 +17,9 @@ @@ -17,8 +17,9 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Linq;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
{
@ -110,7 +111,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -110,7 +111,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return namespaceName; }
set {
if (value == null)
throw new ArgumentNullException();
throw new ArgumentNullException("value");
ThrowIfFrozen();
namespaceName = value;
}
@ -121,18 +122,18 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -121,18 +122,18 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
IUnresolvedTypeDefinition declaringTypeDef = this.DeclaringTypeDefinition;
if (declaringTypeDef != null) {
if (this.TypeParameters.Count > declaringTypeDef.TypeParameters.Count) {
return declaringTypeDef.ReflectionName + "+" + this.Name + "`" + (this.TypeParameters.Count - declaringTypeDef.TypeParameters.Count).ToString();
return declaringTypeDef.ReflectionName + "+" + this.Name + "`" + (this.TypeParameters.Count - declaringTypeDef.TypeParameters.Count).ToString(CultureInfo.InvariantCulture);
} else {
return declaringTypeDef.ReflectionName + "+" + this.Name;
}
} else if (string.IsNullOrEmpty(namespaceName)) {
if (this.TypeParameters.Count > 0)
return this.Name + "`" + this.TypeParameters.Count.ToString();
return this.Name + "`" + this.TypeParameters.Count.ToString(CultureInfo.InvariantCulture);
else
return this.Name;
} else {
if (this.TypeParameters.Count > 0)
return namespaceName + "." + this.Name + "`" + this.TypeParameters.Count.ToString();
return namespaceName + "." + this.Name + "`" + this.TypeParameters.Count.ToString(CultureInfo.InvariantCulture);
else
return namespaceName + "." + this.Name;
}

10
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedTypeParameter.cs

@ -18,8 +18,8 @@ @@ -18,8 +18,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Globalization;
using ICSharpCode.NRefactory.Utils;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
@ -61,7 +61,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -61,7 +61,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
{
this.ownerType = ownerType;
this.index = index;
this.name = name ?? ((ownerType == EntityType.Method ? "!!" : "!") + index.ToString());
this.name = name ?? ((ownerType == EntityType.Method ? "!!" : "!") + index.ToString(CultureInfo.InvariantCulture));
}
public EntityType OwnerType {
@ -95,9 +95,9 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -95,9 +95,9 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
string INamedElement.ReflectionName {
get {
if (ownerType == EntityType.Method)
return "``" + index.ToString();
return "``" + index.ToString(CultureInfo.InvariantCulture);
else
return "`" + index.ToString();
return "`" + index.ToString(CultureInfo.InvariantCulture);
}
}

27
ICSharpCode.NRefactory/TypeSystem/Implementation/FullNameAndTypeParameterCount.cs

@ -22,7 +22,7 @@ using System.Collections.Generic; @@ -22,7 +22,7 @@ using System.Collections.Generic;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
{
[Serializable]
public struct FullNameAndTypeParameterCount
public struct FullNameAndTypeParameterCount : IEquatable<FullNameAndTypeParameterCount>
{
public readonly string Namespace;
public readonly string Name;
@ -38,6 +38,31 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -38,6 +38,31 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
this.Name = name;
this.TypeParameterCount = typeParameterCount;
}
public override bool Equals(object obj)
{
return (obj is FullNameAndTypeParameterCount) && Equals((FullNameAndTypeParameterCount)obj);
}
public bool Equals(FullNameAndTypeParameterCount other)
{
return this.Namespace == other.Namespace && this.Name == other.Name && this.TypeParameterCount == other.TypeParameterCount;
}
public override int GetHashCode()
{
return Name.GetHashCode() ^ Namespace.GetHashCode() ^ TypeParameterCount;
}
public static bool operator ==(FullNameAndTypeParameterCount lhs, FullNameAndTypeParameterCount rhs)
{
return lhs.Equals(rhs);
}
public static bool operator !=(FullNameAndTypeParameterCount lhs, FullNameAndTypeParameterCount rhs)
{
return !lhs.Equals(rhs);
}
}
[Serializable]

2
ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs

@ -18,8 +18,6 @@ @@ -18,8 +18,6 @@
using System;
using System.Linq;
using System.Linq.Expressions;
using ICSharpCode.NRefactory.Utils;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
{

4
ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using ICSharpCode.NRefactory.Utils;
@ -145,7 +146,8 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -145,7 +146,8 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
public override string ToString()
{
return string.Format("[MergedNamespace {0}{1} (from {2} assemblies)]", externAlias != null ? externAlias + "::" : null, this.FullName, this.namespaces.Length);
return string.Format(CultureInfo.InvariantCulture, "[MergedNamespace {0}{1} (from {2} assemblies)]",
externAlias != null ? externAlias + "::" : null, this.FullName, this.namespaces.Length);
}
}
}

2
ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleConstantValue.cs

@ -43,6 +43,8 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -43,6 +43,8 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
return new ConstantResolveResult(type.Resolve(context), value);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase",
Justification = "The C# keyword is lower case")]
public override string ToString()
{
if (value == null)

5
ICSharpCode.NRefactory/TypeSystem/Implementation/TypeParameterReference.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Globalization;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation
{
@ -69,9 +70,9 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -69,9 +70,9 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
public override string ToString()
{
if (ownerType == EntityType.Method)
return "!!" + index.ToString();
return "!!" + index.ToString(CultureInfo.InvariantCulture);
else
return "!" + index.ToString();
return "!" + index.ToString(CultureInfo.InvariantCulture);
}
}
}

2
ICSharpCode.NRefactory/TypeSystem/InheritanceHelper.cs

@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory.TypeSystem @@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory.TypeSystem
/// <summary>
/// Provides helper methods for inheritance.
/// </summary>
public class InheritanceHelper
public static class InheritanceHelper
{
// TODO: maybe these should be extension methods?
// or even part of the interface itself? (would allow for easy caching)

3
ICSharpCode.NRefactory/Utils/BitVector16.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Globalization;
namespace ICSharpCode.NRefactory.Utils
{
@ -76,7 +77,7 @@ namespace ICSharpCode.NRefactory.Utils @@ -76,7 +77,7 @@ namespace ICSharpCode.NRefactory.Utils
public override string ToString()
{
return data.ToString("x4");
return data.ToString("x4", CultureInfo.InvariantCulture);
}
}
}

5
ICSharpCode.NRefactory/Utils/BusyManager.cs

@ -29,13 +29,16 @@ namespace ICSharpCode.NRefactory.Utils @@ -29,13 +29,16 @@ namespace ICSharpCode.NRefactory.Utils
/// </summary>
public static class BusyManager
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible",
Justification = "Should always be used with 'var'")]
public struct BusyLock : IDisposable
{
public static readonly BusyLock Failed = new BusyLock(null);
readonly List<object> objectList;
public BusyLock(List<object> objectList)
internal BusyLock(List<object> objectList)
{
this.objectList = objectList;
}

14
ICSharpCode.NRefactory/Utils/CacheManager.cs

@ -36,9 +36,9 @@ namespace ICSharpCode.NRefactory.Utils @@ -36,9 +36,9 @@ namespace ICSharpCode.NRefactory.Utils
public object GetShared(object key)
{
object val;
sharedDict.TryGetValue(key, out val);
return val;
object value;
sharedDict.TryGetValue(key, out value);
return value;
}
public object GetOrAddShared(object key, Func<object, object> valueFactory)
@ -46,14 +46,14 @@ namespace ICSharpCode.NRefactory.Utils @@ -46,14 +46,14 @@ namespace ICSharpCode.NRefactory.Utils
return sharedDict.GetOrAdd(key, valueFactory);
}
public object GetOrAddShared(object key, object val)
public object GetOrAddShared(object key, object value)
{
return sharedDict.GetOrAdd(key, val);
return sharedDict.GetOrAdd(key, value);
}
public void SetShared(object key, object val)
public void SetShared(object key, object value)
{
sharedDict[key] = val;
sharedDict[key] = value;
}
}
}

4
ICSharpCode.NRefactory/Utils/EmptyList.cs

@ -31,8 +31,8 @@ namespace ICSharpCode.NRefactory @@ -31,8 +31,8 @@ namespace ICSharpCode.NRefactory
private EmptyList() {}
T IList<T>.this[int index] {
get { throw new IndexOutOfRangeException(); }
set { throw new IndexOutOfRangeException(); }
get { throw new ArgumentOutOfRangeException("index"); }
set { throw new ArgumentOutOfRangeException("index"); }
}
int ICollection<T>.Count {

8
ICSharpCode.NRefactory/Utils/FastSerializer.cs

@ -472,7 +472,7 @@ namespace ICSharpCode.NRefactory.Utils @@ -472,7 +472,7 @@ namespace ICSharpCode.NRefactory.Utils
List<FieldInfo> fields = new List<FieldInfo>();
for (Type baseType = type; baseType != null; baseType = baseType.BaseType) {
FieldInfo[] declFields = baseType.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly);
Array.Sort(declFields, (a,b) => a.Name.CompareTo(b.Name));
Array.Sort(declFields, (a,b) => string.Compare(a.Name, b.Name, StringComparison.Ordinal));
fields.AddRange(declFields);
}
fields.RemoveAll(f => f.IsNotSerialized);
@ -806,7 +806,7 @@ namespace ICSharpCode.NRefactory.Utils @@ -806,7 +806,7 @@ namespace ICSharpCode.NRefactory.Utils
return Reader.ReadInt32();
}
internal void DeserializeTypeDescriptions(FastSerializer fastSerializer)
internal void DeserializeTypeDescriptions()
{
for (int i = 0; i < this.Types.Length; i++) {
Type type = this.Types[i];
@ -918,7 +918,7 @@ namespace ICSharpCode.NRefactory.Utils @@ -918,7 +918,7 @@ namespace ICSharpCode.NRefactory.Utils
throw new SerializationException("Unknown type kind");
}
}
context.DeserializeTypeDescriptions(this);
context.DeserializeTypeDescriptions();
int[] typeIDByObjectID = new int[context.Objects.Length];
for (int i = 1 + fixedInstanceCount; i < context.Objects.Length; i++) {
int typeID = context.ReadTypeID();
@ -1296,7 +1296,7 @@ namespace ICSharpCode.NRefactory.Utils @@ -1296,7 +1296,7 @@ namespace ICSharpCode.NRefactory.Utils
return action;
}
CustomDeserializationAction CreateCustomDeserializationAction(Type type)
static CustomDeserializationAction CreateCustomDeserializationAction(Type type)
{
ConstructorInfo ctor = type.GetConstructor(
BindingFlags.DeclaredOnly | BindingFlags.ExactBinding | BindingFlags.Instance

2
ICSharpCode.NRefactory/Utils/LazyInit.cs

@ -28,6 +28,8 @@ namespace ICSharpCode.NRefactory.Utils @@ -28,6 +28,8 @@ namespace ICSharpCode.NRefactory.Utils
{
static volatile object barrier = null;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "tmp",
Justification = "The volatile read is important to cause a read barrier.")]
public static void ReadBarrier()
{
object tmp = barrier;

4
ICSharpCode.NRefactory/Utils/ReferenceComparer.cs

@ -26,9 +26,9 @@ namespace ICSharpCode.NRefactory.Utils @@ -26,9 +26,9 @@ namespace ICSharpCode.NRefactory.Utils
{
public readonly static ReferenceComparer Instance = new ReferenceComparer();
public new bool Equals(object a, object b)
public new bool Equals(object x, object y)
{
return a == b;
return x == y;
}
public int GetHashCode(object obj)

Loading…
Cancel
Save