Skip to content

Commit b84367f

Browse files
authored
Merge branch 'master' into amburns-vsmac
2 parents d4becb1 + 8ce054b commit b84367f

File tree

220 files changed

+5118
-750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+5118
-750
lines changed

.acrolinx-config.edn

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{:allowed-branchname-matches ["master" "release-.*" "sandbox-.*"]
2+
:allowed-filename-matches ["docs" "mac" "scripting-docs"]}

docs/code-quality/ca1052-static-holder-types-should-be-sealed.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ translation.priority.mt:
5050
This rule assumes that a type that contains only static members is not designed to be inherited, because the type does not provide any functionality that can be overridden in a derived type. A type that is not meant to be inherited should be marked with the `sealed` modifier to prohibit its use as a base type.
5151

5252
## How to Fix Violations
53-
To fix a violation of this rule, mark the type as `sealed`. If you are targeting [!INCLUDE[dnprdnshort](../code-quality/includes/dnprdnshort_md.md)] 2.0 or earlier, a better approach is to mark the type as `static`. In this manner, you avoid having to declare a private constructor to prevent the class from being created.
53+
To fix a violation of this rule, mark the type as `sealed`. If you are targeting [!INCLUDE[dnprdnshort](../code-quality/includes/dnprdnshort_md.md)] 2.0 or later, a better approach is to mark the type as `static`. In this manner, you avoid having to declare a private constructor to prevent the class from being created.
5454

5555
## When to Suppress Warnings
5656
Suppress a warning from this rule only if the type is designed to be inherited. The absence of the `sealed` modifier suggests that the type is useful as a base type.
@@ -74,4 +74,4 @@ translation.priority.mt:
7474
[!code-cs[FxCop.Design.StaticMembersFixed#1](../code-quality/codesnippet/CSharp/ca1052-static-holder-types-should-be-sealed_2.cs)]
7575

7676
## Related Rules
77-
[CA1053: Static holder types should not have constructors](../code-quality/ca1053-static-holder-types-should-not-have-constructors.md)
77+
[CA1053: Static holder types should not have constructors](../code-quality/ca1053-static-holder-types-should-not-have-constructors.md)

docs/code-quality/ca1309-use-ordinal-stringcomparison.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ translation.priority.mt:
4747
A string comparison operation that is nonlinguistic does not set the <xref:System.StringComparison> parameter to either **Ordinal** or **OrdinalIgnoreCase**.
4848

4949
## Rule Description
50-
Many string operations, most important the <xref:System.String.Compare%2A?displayProperty=fullName> and <xref:System.String.Equals%2A?displayProperty=fullName> methods, now provide an overload that accepts a <xref:System.StringComparision?displayProperty=fullName> enumeration value as a parameter.
50+
Many string operations, most important the <xref:System.String.Compare%2A?displayProperty=fullName> and <xref:System.String.Equals%2A?displayProperty=fullName> methods, now provide an overload that accepts a <xref:System.StringComparison?displayProperty=fullName> enumeration value as a parameter.
5151

5252
When you specify either **StringComparison.Ordinal** or **StringComparison.OrdinalIgnoreCase**, the string comparison will be nonlinguistic. That is, the features that are specific to the natural language are ignored when comparison decisions are made. This means the decisions are based on simple byte comparisons and ignore casing or equivalence tables that are parameterized by culture. As a result, by explicitly setting the parameter to either the **StringComparison.Ordinal** or **StringComparison.OrdinalIgnoreCase**, your code often gains speed, increases correctness, and becomes more reliable.
5353

docs/code-quality/ca1812-avoid-uninstantiated-internal-classes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ translation.priority.mt:
7777
## When to Suppress Warnings
7878
It is safe to suppress a warning from this rule. We recommend that you suppress this warning in the following situations:
7979

80-
- The class is created through late-bound reflection methods such as <xref:System.Activator.CreateInstance?displayProperty=fullName>.
80+
- The class is created through late-bound reflection methods such as <xref:System.Activator.CreateInstance%2A?displayProperty=fullName>.
8181

8282
- The class is created automatically by the runtime or [!INCLUDE[vstecasp](../code-quality/includes/vstecasp_md.md)]. For example, classes that implement <xref:System.Configuration.IConfigurationSectionHandler?displayProperty=fullName> or <xref:System.Web.IHttpHandler?displayProperty=fullName>.
8383

docs/code-quality/ca1816-call-gc-suppressfinalize-correctly.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ translation.priority.ht:
5353
## Rule Description
5454
The <xref:System.IDisposable.Dispose%2A?displayProperty=fullName> method lets users release resources at any time before the object becoming available for garbage collection. If the <xref:System.IDisposable.Dispose%2A?displayProperty=fullName> method is called, it frees resources of the object. This makes finalization unnecessary. <xref:System.IDisposable.Dispose%2A?displayProperty=fullName> should call <xref:System.GC.SuppressFinalize%2A?displayProperty=fullName> so the garbage collector does not call the finalizer of the object.
5555

56-
To prevent derived types with finalizers from having to re-implement [System.IDisposable](assetId:///System.IDisposable?qualifyHint=True&autoUpgrade=False) and to call it, unsealed types without finalizers should still call <xref:System.GC.SuppressFinalize%2A?displayProperty=fullName>.
56+
To prevent derived types with finalizers from having to re-implement <xref:System.IDisposable> and to call it, unsealed types without finalizers should still call <xref:System.GC.SuppressFinalize%2A?displayProperty=fullName>.
5757

5858
## How to Fix Violations
5959
To fix a violation of this rule:

docs/code-quality/ca1819-properties-should-not-return-arrays.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ translation.priority.mt:
5353
To fix a violation of this rule, either make the property a method or change the property to return a collection.
5454

5555
## When to Suppress Warnings
56-
Attributes can contain properties that return arrays, but cannot contain properties that return collections. You can suppress a warning that is raised for a property of an attribute that is derived from the [System.Attribute](assetId:///System.Attribute?qualifyHint=False&autoUpgrade=True) class. Otherwise, do not suppress a warning from this rule.
56+
Attributes can contain properties that return arrays, but cannot contain properties that return collections. You can suppress a warning that is raised for a property of an attribute that is derived from the <xref:System.Attribute> class. Otherwise, do not suppress a warning from this rule.
5757

5858
## Example Violation
5959

@@ -81,7 +81,7 @@ translation.priority.mt:
8181
### Description
8282
The following example fixes the violation by changing the property to return a
8383

84-
<xref:System.Collection.ObjectModel.ReadOnlyCollection?displayProperty=fullName>.
84+
<xref:System.Collections.ObjectModel.ReadOnlyCollection%601?displayProperty=fullName>.
8585

8686
### Code
8787
[!code-cs[FxCop.Performance.PropertyArrayFixedCollection#1](../code-quality/codesnippet/CSharp/ca1819-properties-should-not-return-arrays_3.cs)]
@@ -97,7 +97,7 @@ translation.priority.mt:
9797
[!code-vb[FxCop.Performance.PropertyModifyViolation#1](../code-quality/codesnippet/VisualBasic/ca1819-properties-should-not-return-arrays_4.vb)]
9898

9999
### Comments
100-
The following example fixes the violation by changing the property to return a <xref:System.Collection.ObjectModel.Collection?displayProperty=fullName>.
100+
The following example fixes the violation by changing the property to return a <xref:System.Collections.ObjectModel.Collection%601?displayProperty=fullName>.
101101

102102
### Code
103103
[!code-vb[FxCop.Performance.PropertyModifyFixed#1](../code-quality/codesnippet/VisualBasic/ca1819-properties-should-not-return-arrays_5.vb)]

docs/code-quality/ca2100-review-sql-queries-for-security-vulnerabilities.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ translation.priority.mt:
6464

6565
- <xref:System.Data.OracleClient.OracleCommand?displayProperty=fullName> and <xref:System.Data.OracleClient.OracleDataAdapter?displayProperty=fullName>
6666

67-
- [System.Data.SqlServerCe.SqlCeCommand](assetId:///System.Data.SqlServerCe.SqlCeCommand?qualifyHint=False&autoUpgrade=True) and [System.Data.SqlServerCe.SqlCeDataAdapter](assetId:///System.Data.SqlServerCe.SqlCeDataAdapter?qualifyHint=False&autoUpgrade=True)
67+
- [System.Data.SqlServerCe.SqlCeCommand](https://msdn.microsoft.com/library/system.data.sqlserverce.sqlcecommand.aspx) and [System.Data.SqlServerCe.SqlCeDataAdapter](https://msdn.microsoft.com/library/system.data.sqlserverce.sqlcedataadapter.aspx)
6868

6969
- <xref:System.Data.SqlClient.SqlCommand?displayProperty=fullName> and <xref:System.Data.SqlClient.SqlDataAdapter?displayProperty=fullName>
7070

docs/code-quality/ca2118-review-suppressunmanagedcodesecurityattribute-usage.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ translation.priority.ht:
8585
<xref:System.Security.SuppressUnmanagedCodeSecurityAttribute?displayProperty=fullName>
8686
[Secure Coding Guidelines](/dotnet/standard/security/secure-coding-guidelines)
8787
[Security Optimizations](http://msdn.microsoft.com/en-us/cf255069-d85d-4de3-914a-e4625215a7c0)
88-
[Data and Modeling](/dotnet/framework/data/index)
89-
[Link Demands](/dotnet/framework/misc/link-demands)
88+
[Data and Modeling](/dotnet/framework/data/index)
89+
[Link Demands](/dotnet/framework/misc/link-demands)
90+

docs/code-quality/ca2208-instantiate-argument-exceptions-correctly.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ translation.priority.ht:
4545
## Cause
4646
Possible causes include the following situations:
4747

48-
- A call is made to the default (parameterless) constructor of an exception type that is, or derives from [System.ArgumentException](assetId:///System.ArgumentException?qualifyHint=True&autoUpgrade=True).
48+
- A call is made to the default (parameterless) constructor of an exception type that is, or derives from <xref:System.ArgumentException>.
4949

50-
- An incorrect string argument is passed to a parameterized constructor of an exception type that is, or derives from [System.ArgumentException.](assetId:///System.ArgumentException.?qualifyHint=True&autoUpgrade=True)
50+
- An incorrect string argument is passed to a parameterized constructor of an exception type that is, or derives from <xref:System.ArgumentException>.
5151

5252
## Rule Description
5353
Instead of calling the default constructor, call one of the constructor overloads that allows a more meaningful exception message to be provided. The exception message should target the developer and clearly explain the error condition and how to correct or avoid the exception.

docs/code-quality/ca2218-override-gethashcode-on-overriding-equals.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,23 @@ translation.priority.ht:
4848
## Rule Description
4949
<xref:System.Object.GetHashCode%2A> returns a value, based on the current instance, that is suited for hashing algorithms and data structures such as a hash table. Two objects that are the same type and are equal must return the same hash code to ensure that instances of the following types work correctly:
5050

51-
- <xref:System.Collections.HashTable?displayProperty=fullName>
51+
- <xref:System.Collections.Hashtable?displayProperty=fullName>
5252

5353
- <xref:System.Collections.SortedList?displayProperty=fullName>
5454

55-
- <xref:System.Collections.Generic.Dictionary?displayProperty=fullName>
55+
- <xref:System.Collections.Generic.Dictionary%602?displayProperty=fullName>
5656

57-
- <xref:System.Collections.Generic.SortDictionary?displayProperty=fullName>
57+
- <xref:System.Collections.Generic.SortedDictionary%602?displayProperty=fullName>
5858

59-
- <xref:System.Collections.Generic.SortList?displayProperty=fullName>
59+
- <xref:System.Collections.Generic.SortedList%602?displayProperty=fullName>
6060

61-
- <xref:System.Collections.Specialized.HybredDictionary?displayProperty=fullName>
61+
- <xref:System.Collections.Specialized.HybridDictionary?displayProperty=fullName>
6262

6363
- <xref:System.Collections.Specialized.ListDictionary?displayProperty=fullName>
6464

6565
- <xref:System.Collections.Specialized.OrderedDictionary?displayProperty=fullName>
6666

67-
- Types that implement <xref:System.Collections.Generic.IEqualityComparer?displayProperty=fullName>
67+
- Types that implement <xref:System.Collections.Generic.IEqualityComparer%601?displayProperty=fullName>
6868

6969
## How to Fix Violations
7070
To fix a violation of this rule, provide an implementation of <xref:System.Object.GetHashCode%2A>. For a pair of objects of the same type, you must ensure that the implementation returns the same value if your implementation of <xref:System.Object.Equals%2A> returns `true` for the pair.
@@ -114,5 +114,5 @@ translation.priority.ht:
114114
## See Also
115115
<xref:System.Object.Equals%2A?displayProperty=fullName>
116116
<xref:System.Object.GetHashCode%2A?displayProperty=fullName>
117-
<xref:System.Collections.HashTable?displayProperty=fullName>
117+
<xref:System.Collections.Hashtable?displayProperty=fullName>
118118
[Equality Operators](/dotnet/standard/design-guidelines/equality-operators)

docs/code-quality/ca2240-implement-iserializable-correctly.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,17 @@ translation.priority.ht:
6868
[!code-vb[FxCop.Usage.ImplementISerializableCorrectly#1](../code-quality/codesnippet/VisualBasic/ca2240-implement-iserializable-correctly_1.vb)]
6969

7070
## Example
71-
The following example fixes the two previous violations by providing an overrideable implementation of [ISerializable.GetObjectData](assetId:///ISerializable.GetObjectData?qualifyHint=False&autoUpgrade=False) on the Book class and by providing an implementation of assetId:///ISerializable.GetObjectData?qualifyHint=False&autoUpgrade=False on the Library class.
71+
The following example fixes the two previous violations by providing an overrideable implementation of <xref:System.Runtime.Serialization.ISerializable.GetObjectData> on the Book class and by providing an implementation of `GetObjectData` on the Library class.
7272

7373
[!code-cpp[FxCop.Usage.ImplementISerializableCorrectly2#1](../code-quality/codesnippet/CPP/ca2240-implement-iserializable-correctly_2.cpp)]
7474
[!code-cs[FxCop.Usage.ImplementISerializableCorrectly2#1](../code-quality/codesnippet/CSharp/ca2240-implement-iserializable-correctly_2.cs)]
7575
[!code-vb[FxCop.Usage.ImplementISerializableCorrectly2#1](../code-quality/codesnippet/VisualBasic/ca2240-implement-iserializable-correctly_2.vb)]
7676

7777
## Related Rules
7878
[CA2236: Call base class methods on ISerializable types](../code-quality/ca2236-call-base-class-methods-on-iserializable-types.md)
79-
8079
[CA2229: Implement serialization constructors](../code-quality/ca2229-implement-serialization-constructors.md)
81-
8280
[CA2238: Implement serialization methods correctly](../code-quality/ca2238-implement-serialization-methods-correctly.md)
83-
8481
[CA2235: Mark all non-serializable fields](../code-quality/ca2235-mark-all-non-serializable-fields.md)
85-
8682
[CA2237: Mark ISerializable types with SerializableAttribute](../code-quality/ca2237-mark-iserializable-types-with-serializableattribute.md)
87-
8883
[CA2239: Provide deserialization methods for optional fields](../code-quality/ca2239-provide-deserialization-methods-for-optional-fields.md)
89-
90-
[CA2120: Secure serialization constructors](../code-quality/ca2120-secure-serialization-constructors.md)
84+
[CA2120: Secure serialization constructors](../code-quality/ca2120-secure-serialization-constructors.md)

docs/code-quality/ca2242-test-for-nan-correctly.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ translation.priority.ht:
4242
|Breaking Change|Non Breaking|
4343

4444
## Cause
45-
An expression tests a value against <xref:System.Single.Nan?displayProperty=fullName> or <xref:System.Double.Nan?displayProperty=fullName>.
45+
An expression tests a value against <xref:System.Single.NaN?displayProperty=fullName> or <xref:System.Double.NaN?displayProperty=fullName>.
4646

4747
## Rule Description
4848
<xref:System.Double.NaN?displayProperty=fullName>, which represents not-a-number, results when an arithmetic operation is undefined. Any expression that tests equality between a value and <xref:System.Double.NaN?displayProperty=fullName> always returns `false`. Any expression that tests inequality between a value and <xref:System.Double.NaN?displayProperty=fullName> always returns `true`.
4949

5050
## How to Fix Violations
51-
To fix a violation of this rule and accurately determine whether a value represents <xref:System.Double.NaN?displayProperty=fullName>, use <xref:System.Single.IsNan%2A?displayProperty=fullName> or <xref:System.Double.IsNan%2A?displayProperty=fullName> to test the value.
51+
To fix a violation of this rule and accurately determine whether a value represents <xref:System.Double.NaN?displayProperty=fullName>, use <xref:System.Single.IsNaN%2A?displayProperty=fullName> or <xref:System.Double.IsNaN%2A?displayProperty=fullName> to test the value.
5252

5353
## When to Suppress Warnings
5454
Do not suppress a warning from this rule.

docs/data-tools/troubleshooting-service-references.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ translation.priority.mt:
3939
This topic lists common issues that may occur when you are working with [!INCLUDE[vsindigo](../data-tools/includes/vsindigo_md.md)] or [!INCLUDE[ssAstoria](../data-tools/includes/ssastoria_md.md)] references in [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)].
4040

4141
## Error Returning Data from a Service
42-
When you return a `DataSet` or `DataTable` from a service, you may receive a "The maximum size quota for incoming messages has been exceeded" exception. By default, the `MaxReceivedMessageSize` property for some bindings is set to a relatively small value to limit exposure to denial-of-service attacks. You can increase this value to prevent the exception. For more information, see <xref:System.ServiceModel.BasicHttpBinding.MaxReceivedMessageSize%2A>.
42+
When you return a `DataSet` or `DataTable` from a service, you may receive a "The maximum size quota for incoming messages has been exceeded" exception. By default, the `MaxReceivedMessageSize` property for some bindings is set to a relatively small value to limit exposure to denial-of-service attacks. You can increase this value to prevent the exception. For more information, see <xref:System.ServiceModel.HttpBindingBase.MaxReceivedMessageSize%2A>.
4343

4444
To fix this error:
4545

0 commit comments

Comments
 (0)