Simplify method isMutualExclusive in Subnet. 59/3759/1
authorAlissa Bonas <abonas@redhat.com>
Mon, 16 Dec 2013 15:28:06 +0000 (17:28 +0200)
committerAlissa Bonas <abonas@redhat.com>
Mon, 16 Dec 2013 15:28:06 +0000 (17:28 +0200)
Remove redundant 'if' statements.

Change-Id: I4ba0b5da22095e5d294eea008119dc49159795af
Signed-off-by: Alissa Bonas <abonas@redhat.com>
opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Subnet.java

index f33fa18e299f62b8680389150c916a28efb06254..0a00cda9afccd185a30785ab5296f3505ac3413c 100644 (file)
@@ -251,17 +251,7 @@ public class Subnet implements Cloneable, Serializable {
     }
 
     public boolean isMutualExclusive(Subnet otherSubnet) {
     }
 
     public boolean isMutualExclusive(Subnet otherSubnet) {
-        if (this.networkAddress.getClass() != otherSubnet.networkAddress
-                .getClass()) {
-            return true;
-        }
-        if (this.isSubnetOf(otherSubnet.getNetworkAddress())) {
-            return false;
-        }
-        if (otherSubnet.isSubnetOf(this.getNetworkAddress())) {
-            return false;
-        }
-        return true;
+        return !(isSubnetOf(otherSubnet.getNetworkAddress()) || otherSubnet.isSubnetOf(getNetworkAddress()));
     }
 
     /**
     }
 
     /**