Small code improvements.

This commit is contained in:
MobiusDev
2017-08-28 03:19:28 +00:00
parent cfb8cc59e2
commit aec0c9dddb
114 changed files with 549 additions and 606 deletions

View File

@@ -54,7 +54,7 @@ public class IPSubnet
_mask = getMask(mask, _addr.length);
if (!applyMask(_addr))
{
throw new UnknownHostException(addr.toString() + "/" + mask);
throw new UnknownHostException(addr + "/" + mask);
}
}
@@ -117,7 +117,7 @@ public class IPSubnet
try
{
return InetAddress.getByAddress(_addr).toString() + "/" + size;
return InetAddress.getByAddress(_addr) + "/" + size;
}
catch (UnknownHostException e)
{
@@ -144,7 +144,7 @@ public class IPSubnet
return false;
}
private static final byte[] getMask(int n, int maxLength) throws UnknownHostException
private static byte[] getMask(int n, int maxLength) throws UnknownHostException
{
if ((n > (maxLength << 3)) || (n < 0))
{