Replacing NotNullAttribute with thrown exceptions

This commit is contained in:
Pranav K 2015-10-07 17:44:11 -07:00
parent aea8716df6
commit bc6502825f
5 changed files with 12 additions and 7 deletions

View File

@ -5,6 +5,9 @@
"type": "git",
"url": "git://github.com/aspnet/websockets"
},
"compilationOptions": {
"warningsAsErrors": true
},
"dependencies": {
"Microsoft.AspNet.WebSockets.Protocol": "1.0.0-*"
},

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNet.WebSockets.Protocol
{
@ -124,8 +123,13 @@ namespace Microsoft.AspNet.WebSockets.Protocol
/// </summary>
/// <param name="requestKey"></param>
/// <returns></returns>
public static string CreateResponseKey([NotNull] string requestKey)
public static string CreateResponseKey(string requestKey)
{
if (requestKey == null)
{
throw new ArgumentNullException(nameof(requestKey));
}
using (var algorithm = SHA1.Create())
{
string merged = requestKey + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";

View File

@ -5,8 +5,8 @@
"type": "git",
"url": "git://github.com/aspnet/websockets"
},
"dependencies": {
"Microsoft.Extensions.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" }
"compilationOptions": {
"warningsAsErrors": true
},
"frameworks": {
"net45": { },

View File

@ -7,7 +7,6 @@ using System.Diagnostics.Contracts;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNet.WebSockets.Protocol.Test
{
@ -256,7 +255,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
return Task.FromResult<object>(null);
}
private static void VerifyBuffer([NotNull] byte[] buffer, int offset, int count, bool allowEmpty)
private static void VerifyBuffer(byte[] buffer, int offset, int count, bool allowEmpty)
{
if (offset < 0 || offset > buffer.Length)
{

View File

@ -1,7 +1,6 @@
{
"dependencies": {
"Microsoft.AspNet.WebSockets.Protocol": "1.0.0-*",
"Microsoft.Extensions.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" },
"xunit.runner.aspnet": "2.0.0-aspnet-*"
},
"frameworks": {