}
InetAddress thisPrefix = getPrefixForAddress(this.networkAddress);
InetAddress otherPrefix = getPrefixForAddress(ip);
- if ((thisPrefix == null) || (otherPrefix == null)) {
- return false;
- }
- if (thisPrefix.equals(otherPrefix)) {
- return true;
- }
- else {
- return false;
+ boolean isSubnetOf = true;
+ if (((thisPrefix == null) || (otherPrefix == null)) || (!thisPrefix.equals(otherPrefix)) ) {
+ isSubnetOf = false;
}
+ return isSubnetOf;
}
public short getVlan() {
if (p == null) {
return false;
}
- if (this.isFlatLayer2()) {
- return true;
- }
- return this.nodeConnectors.contains(p);
+ return isFlatLayer2() || nodeConnectors.contains(p);
}
public boolean isMutualExclusive(Subnet otherSubnet) {