Add curly braces to for and if statements. 72/1572/2
authorAlissa Bonas <abonas@redhat.com>
Tue, 1 Oct 2013 11:35:12 +0000 (14:35 +0300)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 2 Oct 2013 16:14:33 +0000 (16:14 +0000)
Change-Id: I1a681f0de1fe3f2b442d71612b4f15171df48ea2
Signed-off-by: Alissa Bonas <abonas@redhat.com>
opendaylight/networkconfiguration/neutron/implementation/src/main/java/org/opendaylight/controller/networkconfig/neutron/implementation/NeutronPortInterface.java
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet.java
opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6FlowMod.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsReply.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/vendorextension/v6extension/V6StatsRequest.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/SingletonTask.java

index eea19776eceaeecec1701d1e1ea0934e9826ac36..273d4209533112d181f106e490a9b459e9477b2a 100644 (file)
@@ -222,10 +222,12 @@ public class NeutronPortInterface implements INeutronPortCRUD {
             NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());\r
             if (ip.getIpAddress() == null)\r
                 ip.setIpAddress(subnet.getLowAddr());\r
-            if (!ip.getIpAddress().equals(subnet.getGatewayIP()))\r
+            if (!ip.getIpAddress().equals(subnet.getGatewayIP())) {\r
                 subnet.allocateIP(ip.getIpAddress());\r
-            else\r
+            }\r
+            else {\r
                 subnet.setGatewayIPAllocated();\r
+            }\r
             subnet.addPort(input);\r
         }\r
         INeutronNetworkCRUD networkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this);\r
@@ -249,10 +251,12 @@ public class NeutronPortInterface implements INeutronPortCRUD {
         while (fixedIPIterator.hasNext()) {\r
             Neutron_IPs ip = fixedIPIterator.next();\r
             NeutronSubnet subnet = systemCRUD.getSubnet(ip.getSubnetUUID());\r
-            if (!ip.getIpAddress().equals(subnet.getGatewayIP()))\r
+            if (!ip.getIpAddress().equals(subnet.getGatewayIP())) {\r
                 subnet.releaseIP(ip.getIpAddress());\r
-            else\r
+            }\r
+            else {\r
                 subnet.resetGatewayIPAllocated();\r
+            }\r
             subnet.removePort(port);\r
         }\r
         return true;\r
index b1414c37306b86402b02a3bfff528c4753f84114..1072a344b0e1f0ac35e2dab68a420892df6e0ee0 100644 (file)
@@ -318,8 +318,9 @@ public class NeutronSubnet {
         Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator();\r
         while (i.hasNext()) {\r
             NeutronSubnet_IPAllocationPool pool = i.next();\r
-            if (ans == null)\r
+            if (ans == null) {\r
                 ans = pool.getPoolStart();\r
+            }\r
             else\r
                 if (NeutronSubnet_IPAllocationPool.convert(pool.getPoolStart()) <\r
                         NeutronSubnet_IPAllocationPool.convert(ans))\r
index 15401b7522e5ccbdda57782d26e28c343b1aeb7b..b4bbd11704c5f36f97bfa6ca89541022b93988f0 100644 (file)
@@ -112,8 +112,9 @@ public class NeutronSubnet_IPAllocationPool {
         if (r.length == 0) return "";\r
         StringBuilder sb = new StringBuilder();\r
         int i;\r
-        for(i=0;i<r.length-1;i++)\r
+        for(i=0;i<r.length-1;i++) {\r
             sb.append(r[i]+d);\r
+        }\r
         return sb.toString()+r[i];\r
     }\r
 \r
index f7edd30b01cd3424cda925cf29b05ff747020096..73cdd9898fdf88aa29d981d1b7735434c47c390d 100644 (file)
@@ -218,8 +218,9 @@ public class V6FlowMod extends OFVendor implements Cloneable {
             V6FlowMod v6flowMod = (V6FlowMod) super.clone();
             v6flowMod.setMatch(neoMatch);
             List<OFAction> neoActions = new LinkedList<OFAction>();
-            for (OFAction action : this.actions)
+            for (OFAction action : this.actions) {
                 neoActions.add((OFAction) action.clone());
+            }
             v6flowMod.setActions(neoActions);
             return v6flowMod;
         } catch (CloneNotSupportedException e) {
index f8c3d59bb353e120f535b7949b7a005b839b66f5..3ae19838a2136b2be46fc18df026119fa03eb8a4 100644 (file)
@@ -296,8 +296,9 @@ public class V6StatsReply extends OFVendorStatistics {
          * action list may be preceded by a padding of 0 to 7 bytes based upon this:
          */
         short pad_size = (short) (((match_len + 7) / 8) * 8 - match_len);
-        for (i = 0; i < pad_size; i++)
+        for (i = 0; i < pad_size; i++) {
             data.get();
+        }
         int action_len = this.length - MINIMUM_LENGTH - (match_len + pad_size);
         if (action_len > 0)
             this.actions = this.actionFactory.parseActions(data, action_len);
index 1644b1147b1f008b396c089191c83a40ec2324a2..d9c460b32e25b310340eb58ea1f85447a5dbe8e2 100644 (file)
@@ -119,8 +119,9 @@ public class V6StatsRequest extends OFVendorStatistics {
         this.outPort = data.getShort();
         this.match_len = data.getShort();
         this.tableId = data.get();
-        for (int i = 0; i < 3; i++)
+        for (int i = 0; i < 3; i++) {
             data.get();//pad byte
+        }
 
     }
 
@@ -132,8 +133,9 @@ public class V6StatsRequest extends OFVendorStatistics {
         data.putShort(this.outPort);
         data.putShort(this.match_len);
         data.put(this.tableId);
-        for (int i = 0; i < 3; i++)
+        for (int i = 0; i < 3; i++)  {
             data.put((byte) 0x0);//pad byte
+        }
     }
 
     @Override
index 634caac6ed98a8dc8f8f857a7b20b4b74b490144..5d363f128544056a3639f661634bab429896c3a9 100644 (file)
@@ -165,10 +165,12 @@ public class SingletonTask {
         }
 
         if (needQueue) {
-            if (delay <= 0)
+            if (delay <= 0) {
                 ses.execute(stw);
-            else
+            }
+            else {
                 ses.schedule(stw, delay, unit);
+            }
         }
     }
 }
\ No newline at end of file