Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Wraith2 committed Jun 5, 2022
1 parent 63f0561 commit 23ed8a6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Microsoft.Data.SqlClient.SNI
{
internal class TdsParserStateObjectManaged : TdsParserStateObject
internal sealed class TdsParserStateObjectManaged : TdsParserStateObject
{
private SNIMarsConnection? _marsConnection;
private SNIHandle? _sessionHandle;
Expand Down Expand Up @@ -46,7 +46,7 @@ protected override void CreateSessionHandle(TdsParserStateObject physicalConnect
}
else
{
throw ADP.InvalidOperation("physicalConnection type is incorrect");
throw new ArgumentException(StringsHelper.GetString(StringsHelper.SNI_IncorrectPhysicalConnectionType));
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,9 @@
<data name="SQL_ParameterDirectionInvalidForOptimizedBinding" xml:space="preserve">
<value>Parameter '{0}' cannot have Direction Output or InputOutput when EnableOptimizedParameterBinding is enabled on the parent command.</value>
</data>
<data name="SNI_IncorrectPhysicalConnectionType" xml:space="preserve">
<value>incorrect physicalConnection type</value>
</data>
<data name="DataCategory_Update" xml:space="preserve">
<value>Update</value>
</data>
Expand Down
47 changes: 23 additions & 24 deletions src/Microsoft.Data.SqlClient/src/System/Diagnostics/CodeAnalysis.cs
Original file line number Diff line number Diff line change
@@ -1,59 +1,58 @@
using System;
using System.Diagnostics.CodeAnalysis;

#pragma warning disable 1591
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Diagnostics.CodeAnalysis
{
#if NETSTANDARD2_0
[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)]
sealed class AllowNullAttribute : Attribute
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)]
internal sealed class AllowNullAttribute : Attribute
{
}

[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)]
sealed class DisallowNullAttribute : Attribute
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)]
internal sealed class DisallowNullAttribute : Attribute
{
}

[AttributeUsageAttribute(AttributeTargets.Method)]
sealed class DoesNotReturnAttribute : Attribute
[AttributeUsage(AttributeTargets.Method)]
internal sealed class DoesNotReturnAttribute : Attribute
{
}

[AttributeUsageAttribute(AttributeTargets.Parameter)]
sealed class DoesNotReturnIfAttribute : Attribute
[AttributeUsage(AttributeTargets.Parameter)]
internal sealed class DoesNotReturnIfAttribute : Attribute
{
public DoesNotReturnIfAttribute(bool parameterValue) => ParameterValue = parameterValue;
public bool ParameterValue { get; }
}

[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]
sealed class MaybeNullAttribute : Attribute
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]
internal sealed class MaybeNullAttribute : Attribute
{
}

[AttributeUsageAttribute(AttributeTargets.Parameter)]
sealed class MaybeNullWhenAttribute : Attribute
[AttributeUsage(AttributeTargets.Parameter)]
internal sealed class MaybeNullWhenAttribute : Attribute
{
public MaybeNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
public bool ReturnValue { get; }
}

[AttributeUsageAttribute(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]
sealed class NotNullAttribute : Attribute
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]
internal sealed class NotNullAttribute : Attribute
{
}

[AttributeUsageAttribute(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true)]
sealed class NotNullIfNotNullAttribute : Attribute
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true)]
internal sealed class NotNullIfNotNullAttribute : Attribute
{
public NotNullIfNotNullAttribute(string parameterName) => ParameterName = parameterName;
public string ParameterName { get; }
}

[AttributeUsageAttribute(AttributeTargets.Parameter)]
sealed class NotNullWhenAttribute : Attribute
[AttributeUsage(AttributeTargets.Parameter)]
internal sealed class NotNullWhenAttribute : Attribute
{
public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue;
public bool ReturnValue { get; }
Expand All @@ -62,7 +61,7 @@ sealed class NotNullWhenAttribute : Attribute

#if !NET5_0_OR_GREATER
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = false)]
sealed class MemberNotNullAttribute : Attribute
internal sealed class MemberNotNullAttribute : Attribute
{
public MemberNotNullAttribute(string member) => Members = new string[]
{
Expand All @@ -75,7 +74,7 @@ sealed class MemberNotNullAttribute : Attribute
}

[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true, Inherited = false)]
sealed class MemberNotNullWhenAttribute : Attribute
internal sealed class MemberNotNullWhenAttribute : Attribute
{
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
Expand Down

0 comments on commit 23ed8a6

Please sign in to comment.