Using [NotNull]

This commit is contained in:
Hisham Abdullah Bin Ateya 2015-06-11 23:28:12 +03:00 committed by Chris R
parent 7fcbefc86f
commit 797e1287e3
4 changed files with 9 additions and 27 deletions

View File

@ -5,8 +5,8 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IdentityModel.Tokens; using System.IdentityModel.Tokens;
using System.Net.Http; using System.Net.Http;
using Microsoft.IdentityModel.Protocols;
using Microsoft.Framework.Internal; using Microsoft.Framework.Internal;
using Microsoft.IdentityModel.Protocols;
namespace Microsoft.AspNet.Authentication.OAuthBearer namespace Microsoft.AspNet.Authentication.OAuthBearer
{ {
@ -140,14 +140,9 @@ namespace Microsoft.AspNet.Authentication.OAuthBearer
{ {
return _tokenValidationParameters; return _tokenValidationParameters;
} }
[param: NotNull]
set set
{ {
if (value == null)
{
throw new ArgumentNullException("TokenValidationParameters");
}
_tokenValidationParameters = value; _tokenValidationParameters = value;
} }
} }

View File

@ -528,9 +528,9 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
/// The value of the cookie is: "N".</remarks> /// The value of the cookie is: "N".</remarks>
private void WriteNonceCookie(string nonce) private void WriteNonceCookie(string nonce)
{ {
if (string.IsNullOrWhiteSpace(nonce)) if (string.IsNullOrEmpty(nonce))
{ {
throw new ArgumentNullException("nonce"); throw new ArgumentNullException(nameof(nonce));
} }
Response.Cookies.Append( Response.Cookies.Append(

View File

@ -8,8 +8,8 @@ using System.IdentityModel.Tokens;
using System.Net.Http; using System.Net.Http;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Authentication; using Microsoft.AspNet.Http.Authentication;
using Microsoft.IdentityModel.Protocols;
using Microsoft.Framework.Internal; using Microsoft.Framework.Internal;
using Microsoft.IdentityModel.Protocols;
namespace Microsoft.AspNet.Authentication.OpenIdConnect namespace Microsoft.AspNet.Authentication.OpenIdConnect
{ {
@ -252,13 +252,9 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
{ {
return _stateDataFormat; return _stateDataFormat;
} }
[param: NotNull]
set set
{ {
if (value == null)
{
throw new ArgumentNullException("value");
}
_stateDataFormat = value; _stateDataFormat = value;
} }
} }
@ -272,13 +268,9 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
{ {
return _stringDataFormat; return _stringDataFormat;
} }
[param: NotNull]
set set
{ {
if (value == null)
{
throw new ArgumentNullException("value");
}
_stringDataFormat = value; _stringDataFormat = value;
} }
} }
@ -315,14 +307,9 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
{ {
return _tokenValidationParameters; return _tokenValidationParameters;
} }
[param: NotNull]
set set
{ {
if (value == null)
{
throw new ArgumentNullException("value");
}
_tokenValidationParameters = value; _tokenValidationParameters = value;
} }
} }

View File

@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Authentication
if (_validSubjectKeyIdentifiers.Count == 0) if (_validSubjectKeyIdentifiers.Count == 0)
{ {
throw new ArgumentOutOfRangeException(nameof(_validSubjectKeyIdentifiers)); throw new ArgumentOutOfRangeException(nameof(validSubjectKeyIdentifiers));
} }
} }