Fix Major Sonar Issues: NorthboundEvent.java.
authorMarcus Koontz <marcus.g.koontz@intel.com>
Fri, 21 Nov 2014 01:28:03 +0000 (17:28 -0800)
committerMarcus Koontz <marcus.g.koontz@intel.com>
Fri, 21 Nov 2014 01:28:03 +0000 (17:28 -0800)
Fixes the following issues:
- 22 Avoid using If/If else/For statements without curly braces

https://sonar.opendaylight.org/component#component=org.opendaylight.ovsdb:openstack.net-virt:master:src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NorthboundEvent.java

Change-Id: I84271baabf37d732fbaf34869b4a60ba697789e8
Signed-off-by: Marcus Koontz <marcus.g.koontz@intel.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/NorthboundEvent.java

index a901e3da6ce396930991988a5e85a0dcfe31bf66..3b0a9e94cfce2a15108241bb762e252078fbdf83 100644 (file)
@@ -137,60 +137,82 @@ public class NorthboundEvent extends AbstractEvent {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
-        if (!super.equals(obj))
+        }
+        if (!super.equals(obj)) {
             return false;
+        }
         NorthboundEvent other = (NorthboundEvent) obj;
         if (port == null) {
-            if (other.port != null)
+            if (other.port != null) {
                 return false;
-        } else if (!port.equals(other.port))
+            }
+        } else if (!port.equals(other.port)) {
             return false;
+        }
         if (subnet == null) {
-            if (other.subnet != null)
+            if (other.subnet != null) {
                 return false;
-        } else if (!subnet.equals(other.subnet))
+            }
+        } else if (!subnet.equals(other.subnet)) {
             return false;
+        }
         if (router == null) {
-            if (other.router != null)
+            if (other.router != null) {
                 return false;
-        } else if (!router.equals(other.router))
+            }
+        } else if (!router.equals(other.router)) {
             return false;
+        }
         if (routerInterface == null) {
-            if (other.routerInterface != null)
+            if (other.routerInterface != null) {
                 return false;
-        } else if (!routerInterface.equals(other.routerInterface))
+            }
+        } else if (!routerInterface.equals(other.routerInterface)) {
             return false;
+        }
         if (neutronFloatingIP == null) {
-            if (other.neutronFloatingIP != null)
+            if (other.neutronFloatingIP != null) {
                 return false;
-        } else if (!neutronFloatingIP.equals(other.neutronFloatingIP))
+            }
+        } else if (!neutronFloatingIP.equals(other.neutronFloatingIP)) {
             return false;
+        }
         if (neutronNetwork == null) {
-            if (other.neutronNetwork != null)
+            if (other.neutronNetwork != null) {
                 return false;
-        } else if (!neutronNetwork.equals(other.neutronNetwork))
+            }
+        } else if (!neutronNetwork.equals(other.neutronNetwork)) {
             return false;
+        }
         if (loadBalancer == null) {
-            if (other.loadBalancer != null)
+            if (other.loadBalancer != null) {
                 return false;
-        } else if (!loadBalancer.equals(other.loadBalancer))
+            }
+        } else if (!loadBalancer.equals(other.loadBalancer)) {
             return false;
+        }
         if (loadBalancerPool == null) {
-            if (other.loadBalancerPool != null)
+            if (other.loadBalancerPool != null) {
                 return false;
-        } else if (!loadBalancerPool.equals(other.loadBalancerPool))
+            }
+        } else if (!loadBalancerPool.equals(other.loadBalancerPool)) {
             return false;
+        }
         if (loadBalancerPoolMember == null) {
-            if (other.loadBalancerPoolMember != null)
+            if (other.loadBalancerPoolMember != null) {
                 return false;
-        } else if (!loadBalancerPoolMember.equals(other.loadBalancerPoolMember))
+            }
+        } else if (!loadBalancerPoolMember.equals(other.loadBalancerPoolMember)) {
             return false;
+        }
         return true;
     }
 }