From 458ff7ce24b33f6df46ae8ef728685c555d55ff7 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 7 Jan 2021 15:37:28 -0800 Subject: Remove unnecessary SuppressMessage attributes --- src/WixToolset.Core/Compiler.cs | 9 --------- src/WixToolset.Core/CompilerCore.cs | 11 ----------- src/WixToolset.Core/Compiler_2.cs | 12 ------------ src/WixToolset.Core/Compiler_Patch.cs | 1 - 4 files changed, 33 deletions(-) diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 62ea8aaf..14b28034 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs @@ -676,7 +676,6 @@ namespace WixToolset.Core /// /// Element to parse. /// Identifier for the new row. - [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private Identifier ParseBinaryElement(XElement node) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -2102,7 +2101,6 @@ namespace WixToolset.Core /// Optional disk id inherited from parent directory. /// Optional identifier for component's directory. /// Optional source path for files up to this point. - [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private void ParseComponentElement(XElement node, ComplexReferenceParentType parentType, string parentId, string parentLanguage, int diskId, string directoryId, string srcPath) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -2573,7 +2571,6 @@ namespace WixToolset.Core /// Element to parse. /// /// - [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private void ParseComponentGroupElement(XElement node, ComplexReferenceParentType parentType, string parentId) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -4135,7 +4132,6 @@ namespace WixToolset.Core /// Optional identifier of parent directory. /// Disk id inherited from parent directory. /// Path to source file as of yet. - [SuppressMessage("Microsoft.Performance", "CA1820:TestForEmptyStringsUsingStringLength")] private void ParseDirectoryElement(XElement node, string parentId, int diskId, string fileSource) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -4363,7 +4359,6 @@ namespace WixToolset.Core /// Parses a directory reference element. /// /// Element to parse. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private void ParseDirectoryRefElement(XElement node) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -4711,7 +4706,6 @@ namespace WixToolset.Core /// Optional identifer for parent feature. /// Display value for last feature used to get the features to display in the same order as specified /// in the source code. - [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private void ParseFeatureElement(XElement node, ComplexReferenceParentType parentType, string parentId, ref int lastDisplay) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -4935,7 +4929,6 @@ namespace WixToolset.Core /// Element to parse. /// The type of parent. /// Optional identifier for parent feature. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private void ParseFeatureRefElement(XElement node, ComplexReferenceParentType parentType, string parentId) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -5029,7 +5022,6 @@ namespace WixToolset.Core /// Element to parse. /// /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private void ParseFeatureGroupElement(XElement node, ComplexReferenceParentType parentType, string parentId) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -5484,7 +5476,6 @@ namespace WixToolset.Core /// true if the component is 64-bit. /// /// Yes if this element was marked as the parent component's key path, No if explicitly marked as not being a key path, or NotSet otherwise. - [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private YesNoType ParseFileElement(XElement node, string componentId, string directoryId, int diskId, string sourcePath, out string possibleKeyPath, bool win64Component, string componentGuid) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index 50b88e51..1f6d6329 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs @@ -493,7 +493,6 @@ namespace WixToolset.Core /// The attribute containing the value to get. /// A rule for the contents of the value. If the contents do not follow the rule, an error is thrown. /// The attribute's value. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public string GetAttributeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule = EmptyRule.CanBeWhitespaceOnly) { return this.parseHelper.GetAttributeValue(sourceLineNumbers, attribute, emptyRule); @@ -505,7 +504,6 @@ namespace WixToolset.Core /// Source line information about the owner element. /// The attribute containing the value to get. /// A valid code page integer value. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public int GetAttributeCodePageValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) { if (null == attribute) @@ -535,7 +533,6 @@ namespace WixToolset.Core /// The attribute containing the value to get. /// Whether to allow Unicode (UCS) or UTF code pages. /// A valid code page integer value or variable expression. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public string GetAttributeLocalizableCodePageValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool onlyAnsi = false) { if (null == attribute) @@ -577,7 +574,6 @@ namespace WixToolset.Core /// The minimum legal value. /// The maximum legal value. /// The attribute's integer value or a special value if an error occurred during conversion. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public int GetAttributeIntegerValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, int minimum, int maximum) { return this.parseHelper.GetAttributeIntegerValue(sourceLineNumbers, attribute, minimum, maximum); @@ -602,7 +598,6 @@ namespace WixToolset.Core /// Source line information about the owner element. /// The attribute containing the value to get. /// Int representation of the date time. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public int GetAttributeDateTimeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) { if (null == attribute) @@ -748,7 +743,6 @@ namespace WixToolset.Core /// Source line information about the owner element. /// The attribute containing the value to get. /// The attribute's YesNoDefaultType value. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public YesNoDefaultType GetAttributeYesNoDefaultValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) { return this.parseHelper.GetAttributeYesNoDefaultValue(sourceLineNumbers, attribute); @@ -793,7 +787,6 @@ namespace WixToolset.Core /// true if wildcards are allowed in the filename. /// true if relative paths are allowed in the filename. /// The attribute's long filename value. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public string GetAttributeLongFilename(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool allowWildcards = false, bool allowRelative = false) { return this.parseHelper.GetAttributeLongFilename(sourceLineNumbers, attribute, allowWildcards, allowRelative); @@ -817,7 +810,6 @@ namespace WixToolset.Core /// The attribute containing the value to get. /// Whether HKMU is returned as -1 (true), or treated as an error (false). /// The attribute's RegisitryRootType value. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public RegistryRootType? GetAttributeRegistryRootValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool allowHkmu) { return this.parseHelper.GetAttributeRegistryRootValue(sourceLineNumbers, attribute, allowHkmu); @@ -829,7 +821,6 @@ namespace WixToolset.Core /// Source line information about the owner element. /// The attribute containing the value to get. /// The attribute's value. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public string GetAttributeBundleVariableValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) { string value = this.GetAttributeValue(sourceLineNumbers, attribute); @@ -852,7 +843,6 @@ namespace WixToolset.Core /// Source line information about the owner element. /// The attribute containing the value to get. /// The attribute's value. - [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")] public string GetAttributeMsiPropertyNameValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) { string value = this.GetAttributeValue(sourceLineNumbers, attribute); @@ -885,7 +875,6 @@ namespace WixToolset.Core /// Three letter or less prefix for generated row identifier. /// Information to hash. /// The generated identifier. - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] public Identifier CreateIdentifier(string prefix, params string[] args) { return this.parseHelper.CreateIdentifier(prefix, args); diff --git a/src/WixToolset.Core/Compiler_2.cs b/src/WixToolset.Core/Compiler_2.cs index d2a6bb83..af56f0ef 100644 --- a/src/WixToolset.Core/Compiler_2.cs +++ b/src/WixToolset.Core/Compiler_2.cs @@ -1523,9 +1523,6 @@ namespace WixToolset.Core /// true if the component is 64-bit. /// Identifier of this registry key since it could be the component's keypath. /// Yes if this element was marked as the parent component's key path, No if explicitly marked as not being a key path, or NotSet otherwise. - [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Changing the way this string normalizes would result " + - "in a change to the way the Registry table is generated, potentially causing extra churn in patches on an MSI built from an older version of WiX. " + - "Furthermore, there is no security hole here, as the strings won't need to make a round trip")] private YesNoType ParseRegistryKeyElement(XElement node, string componentId, RegistryRootType? root, string parentKey, bool win64Component, out string possibleKeyPath) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -1718,9 +1715,6 @@ namespace WixToolset.Core /// true if the component is 64-bit. /// Identifier of this registry key since it could be the component's keypath. /// Yes if this element was marked as the parent component's key path, No if explicitly marked as not being a key path, or NotSet otherwise. - [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Changing the way this string normalizes would result " + - "in a change to the way the Registry table is generated, potentially causing extra churn in patches on an MSI built from an older version of WiX. " + - "Furthermore, there is no security hole here, as the strings won't need to make a round trip")] private YesNoType ParseRegistryValueElement(XElement node, string componentId, RegistryRootType? root, string parentKey, bool win64Component, out string possibleKeyPath) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -1994,9 +1988,6 @@ namespace WixToolset.Core /// /// The element to parse. /// The component identifier of the parent element. - [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Changing the way this string normalizes would result " + - "in a change to the way the Registry table is generated, potentially causing extra churn in patches on an MSI built from an older version of WiX. " + - "Furthermore, there is no security hole here, as the strings won't need to make a round trip")] private void ParseRemoveRegistryKeyElement(XElement node, string componentId) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); @@ -2097,9 +2088,6 @@ namespace WixToolset.Core /// /// The element to parse. /// The component identifier of the parent element. - [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Changing the way this string normalizes would result " + - "in a change to the way the Registry table is generated, potentially causing extra churn in patches on an MSI built from an older version of WiX. " + - "Furthermore, there is no security hole here, as the strings won't need to make a round trip")] private void ParseRemoveRegistryValueElement(XElement node, string componentId) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); diff --git a/src/WixToolset.Core/Compiler_Patch.cs b/src/WixToolset.Core/Compiler_Patch.cs index eb99d5c4..2fb1affb 100644 --- a/src/WixToolset.Core/Compiler_Patch.cs +++ b/src/WixToolset.Core/Compiler_Patch.cs @@ -448,7 +448,6 @@ namespace WixToolset.Core /// Element to parse. /// /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private void ParsePatchFamilyGroupElement(XElement node, ComplexReferenceParentType parentType, string parentId) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); -- cgit v1.2.3-55-g6feb