Remove main()s in the ipfilter package

- They really should not be there.
This commit is contained in:
Trustin Lee 2012-05-31 16:08:48 -07:00
parent ec5bd42b18
commit 75f0de5b41
2 changed files with 0 additions and 42 deletions

View File

@ -142,26 +142,4 @@ public class IpSubnet implements IpSet, Comparable<IpSubnet> {
public int compareTo(IpSubnet o) {
return cidr.toString().compareTo(o.cidr.toString());
}
/**
* Simple test functions
*
* @param args where args[0] is the netmask (standard or CIDR notation) and optional args[1] is
* the inetAddress to test with this IpSubnet
*/
public static void main(String[] args) throws Exception {
if (args.length != 0) {
IpSubnet ipSubnet = null;
try {
ipSubnet = new IpSubnet(args[0]);
} catch (UnknownHostException e) {
return;
}
logger.debug("IpSubnet: " + ipSubnet.toString() + " from " + ipSubnet.cidr.getBaseAddress() + " to "
+ ipSubnet.cidr.getEndAddress() + " mask " + ipSubnet.cidr.getMask());
if (args.length > 1) {
logger.debug("Is IN: " + args[1] + " " + ipSubnet.contains(args[1]));
}
}
}
}

View File

@ -252,24 +252,4 @@ public class IpV4Subnet implements IpSet, Comparable<IpV4Subnet> {
}
return 1;
}
/**
* Simple test functions
*
* @param args where args[0] is the netmask (standard or CIDR notation) and optional args[1] is
* the inetAddress to test with this IpV4Subnet
*/
public static void main(String[] args) throws Exception {
if (args.length != 0) {
IpV4Subnet ipV4Subnet = null;
try {
ipV4Subnet = new IpV4Subnet(args[0]);
} catch (UnknownHostException e) {
return;
}
if (args.length > 1) {
logger.debug("Is IN: " + args[1] + " " + ipV4Subnet.contains(args[1]));
}
}
}
}