Mayor code cleanup

Add Argument*Exceptions now use proper nameof operators.

Added exception messages to quite a few Argument*Exceptions.

Fixed rethorwing to be proper syntax.

Added a ton of null checkes. (This is only a start, there are about 500 places that need proper null handling)

Added some TODOs to log certain exceptions.

Fix sln again.

Fixed all AssemblyInfo's and added proper copyright (where I could find them)

We live in *current year*.

Fixed the use of braces.

Fixed a ton of properties, and made a fair amount of functions static that should be and can be static.

Made more Methods that should be static static.

You can now use static to find bad functions!

Removed unused variable. And added one more proper XML comment.
This commit is contained in:
Erwin de Haan
2019-01-06 21:50:43 +01:00
parent 3d867c2c46
commit ec1f5dc317
334 changed files with 1632 additions and 2603 deletions

View File

@@ -11,22 +11,12 @@ namespace System.Net
private byte _cidrSubnet;
private IPNetwork _ipnetwork;
private byte _cidr
{
get { return this._ipnetwork.Cidr; }
}
private BigInteger _broadcast
{
get { return IPNetwork.ToBigInteger(this._ipnetwork.Broadcast); }
}
private BigInteger _lastUsable
{
get { return IPNetwork.ToBigInteger(this._ipnetwork.LastUsable); }
}
private BigInteger _network
{
get { return IPNetwork.ToBigInteger(this._ipnetwork.Network); }
}
private byte _cidr => this._ipnetwork.Cidr;
private BigInteger _broadcast => IPNetwork.ToBigInteger(this._ipnetwork.Broadcast);
private BigInteger _lastUsable => IPNetwork.ToBigInteger(this._ipnetwork.LastUsable);
private BigInteger _network => IPNetwork.ToBigInteger(this._ipnetwork.Network);
#if TRAVISCI
public
#else
@@ -38,7 +28,7 @@ namespace System.Net
int maxCidr = ipnetwork.AddressFamily == Sockets.AddressFamily.InterNetwork ? 32 : 128;
if (cidrSubnet > maxCidr)
{
throw new ArgumentOutOfRangeException("cidrSubnet");
throw new ArgumentOutOfRangeException(nameof(cidrSubnet));
}
if (cidrSubnet < ipnetwork.Cidr)
@@ -68,7 +58,7 @@ namespace System.Net
{
if (i >= this.Count)
{
throw new ArgumentOutOfRangeException("i");
throw new ArgumentOutOfRangeException(nameof(i));
}
BigInteger last = this._ipnetwork.AddressFamily == Sockets.AddressFamily.InterNetworkV6
@@ -96,10 +86,7 @@ namespace System.Net
#region IEnumerator<IPNetwork> Members
public IPNetwork Current
{
get { return this[this._enumerator]; }
}
public IPNetwork Current => this[this._enumerator];
#endregion
@@ -115,10 +102,7 @@ namespace System.Net
#region IEnumerator Members
object IEnumerator.Current
{
get { return this.Current; }
}
object IEnumerator.Current => this.Current;
public bool MoveNext()
{