Pay down technical debt: remove trailing comments 75/23275/3
authorRyan Moats <rmoats@us.ibm.com>
Thu, 25 Jun 2015 14:24:17 +0000 (09:24 -0500)
committerRyan Moats <rmoats@us.ibm.com>
Mon, 29 Jun 2015 14:43:44 +0000 (09:43 -0500)
Squid includes a rule that Comments should not be located at the
end of lines of code to ensure readability. The main idea behind
this rule is that in order to be really readable, trailing comments
would have to be property written and formatted (correct alignment,
no interference with the visual structure of the code, not too long
to be visible) but most often, automatic code formatters would not
handle this correctly: the code would end up less readable.

Therefore, comments are far better placed on the previous empty
line of code, where they will always be visible and properly
formatted.

Change-Id: I5b1db07b0995d48508f7770a88ad807326b5a0e5
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronNetwork.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronNetwork_Segment.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronSubnet.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNIPSECSiteConnection.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronVPNService.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFirewallPolicyNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronFloatingIPsNorthbound.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronNorthboundRSApplication.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/AbstractNeutronInterface.java

index 81127e974dcef76c3da1ca03b37e8417df2f884e..efd13b5aec424b253bae2836a34c6761ad32b34d 100644 (file)
@@ -28,42 +28,42 @@ public class NeutronNetwork implements Serializable, INeutronObject {
     private static final long serialVersionUID = 1L;
 
     @XmlElement (name = "id")
-    String networkUUID;              // network UUID
+    String networkUUID;
 
     @XmlElement (name = "name")
-    String networkName;              // name
+    String networkName;
 
     @XmlElement (defaultValue = "true", name = "admin_state_up")
-    Boolean adminStateUp;             // admin state up (true/false)
+    Boolean adminStateUp;
 
     @XmlElement (defaultValue = "false", name = "shared")
-    Boolean shared;                   // shared network or not
+    Boolean shared;
 
     @XmlElement (name = "tenant_id")
-    String tenantID;                 // tenant for this network
+    String tenantID;
 
     //    @XmlElement (defaultValue = "false", name = "router:external")
     @XmlElement (defaultValue="false", namespace="router", name="external")
-    Boolean routerExternal;           // network external or not
+    Boolean routerExternal;
 
     //    @XmlElement (defaultValue = "flat", name = "provider:network_type")
     @XmlElement (namespace="provider", name="network_type")
-    String providerNetworkType;      // provider network type (flat or vlan)
+    String providerNetworkType;
 
     //    @XmlElement (name = "provider:physical_network")
     @XmlElement (namespace="provider", name="physical_network")
-    String providerPhysicalNetwork;  // provider physical network (name)
+    String providerPhysicalNetwork;
 
     //    @XmlElement (name = "provider:segmentation_id")
     @XmlElement (namespace="provider", name="segmentation_id")
 
-    String providerSegmentationID;   // provide segmentation ID (vlan ID)
+    String providerSegmentationID;
 
     @XmlElement (name = "status")
-    String status;                   // status (read-only)
+    String status;
 
     @XmlElement (name = "subnets")
-    List<String> subnets;            // subnets (read-only)
+    List<String> subnets;
 
     @XmlElement (name="segments")
     List<NeutronNetwork_Segment> segments;
index d2f4ad2c88f31929ed202f9a2c04f4b9c0df91ab..0e6e533a5f63d20d85bea2a00184b691babad223 100644 (file)
@@ -26,15 +26,15 @@ public class NeutronNetwork_Segment implements Serializable {
 
     //    @XmlElement (defaultValue="flat", name="provider:network_type")
     @XmlElement (defaultValue="flat", namespace="provider", name="network_type")
-    String providerNetworkType;      // provider network type (flat or vlan)
+    String providerNetworkType;
 
     //    @XmlElement (name="provider:physical_network")
     @XmlElement (namespace="provider", name="physical_network")
-    String providerPhysicalNetwork;  // provider physical network (name)
+    String providerPhysicalNetwork;
 
     //    @XmlElement (name="provider:segmentation_id")
     @XmlElement (namespace="provider", name="segmentation_id")
-    String providerSegmentationID;   // provide segmentation ID (vlan ID)
+    String providerSegmentationID;
 
     public NeutronNetwork_Segment() {
     }
index d59caed094043b2b6b9976fb4a06146ce296c509..50630fd503e53b02c9f60803f461e0d89ef145f6 100644 (file)
@@ -293,7 +293,7 @@ public class NeutronSubnet implements Serializable, INeutronObject {
                 // convert to byte array
                 byte[] addrBytes = ((Inet6Address) InetAddress.getByName(parts[0])).getAddress();
                 int i;
-                for (i = length; i < IPV6_LENGTH; i++) { // offset is to ensure proper comparison
+                for (i = length; i < IPV6_LENGTH; i++) {
                     if (((((int) addrBytes[i/IPV6_LENGTH_BYTES]) & IPV6_LSB_MASK) & (1 << (IPV6_BYTE_OFFSET-(i%IPV6_LENGTH_BYTES)))) != 0) {
                         return(false);
                     }
@@ -456,7 +456,7 @@ public class NeutronSubnet implements Serializable, INeutronObject {
                 byte[] cidrBytes = ((Inet6Address) InetAddress.getByName(parts[0])).getAddress();
                 byte[] ipBytes =  ((Inet6Address) InetAddress.getByName(ipAddress)).getAddress();
                 int i;
-                for (i = 0; i < length; i++) { // offset is to ensure proper comparison
+                for (i = 0; i < length; i++) {
                     if (((((int) cidrBytes[i/IPV6_LENGTH_BYTES]) & IPV6_LSB_MASK) & (1 << (IPV6_BYTE_OFFSET-(i%IPV6_LENGTH_BYTES)))) !=
                         ((((int) ipBytes[i/IPV6_LENGTH_BYTES]) & IPV6_LSB_MASK) & (1 << (IPV6_BYTE_OFFSET-(i%IPV6_LENGTH_BYTES))))) {
                         return(false);
@@ -528,7 +528,7 @@ public class NeutronSubnet implements Serializable, INeutronObject {
      */
     public void allocateIP(String ipAddress) {
         Iterator<NeutronSubnet_IPAllocationPool> i = allocationPools.iterator();
-        List<NeutronSubnet_IPAllocationPool> newList = new ArrayList<NeutronSubnet_IPAllocationPool>();    // we have to modify a separate list
+        List<NeutronSubnet_IPAllocationPool> newList = new ArrayList<NeutronSubnet_IPAllocationPool>();
         while (i.hasNext()) {
             NeutronSubnet_IPAllocationPool pool = i.next();
             /* if the pool contains a single address element and we are allocating it
index f549bfb4462ae79684bc3ccb4ed664ac617d99b9..47a6206c21f1fecbb7f6eb2986ff90dabe5b45bb 100644 (file)
@@ -63,10 +63,10 @@ public class NeutronVPNIPSECSiteConnection implements Serializable, INeutronObje
     String initiator;
 
     @XmlElement (defaultValue = "true", name = "admin_state_up")
-    Boolean adminStateUp;             // admin state up (true/false)
+    Boolean adminStateUp;
 
     @XmlElement (name = "status")
-    String status;                   // status (read-only)
+    String status;
 
     @XmlElement (name = "ikepolicy_id")
     String ikePolicyID;
index 2da34bd5b15312bc8eaea6d8f10df127050391de..128ed39a9f49d8cf6e56d2654c6faa31cc5d0976 100644 (file)
@@ -37,7 +37,7 @@ public class NeutronVPNService implements Serializable, INeutronObject {
     String name;
 
     @XmlElement (defaultValue = "true", name = "admin_state_up")
-    Boolean adminStateUp;             // admin state up (true/false)
+    Boolean adminStateUp;
 
     @XmlElement (name = "subnet_id")
     String subnetUUID;
index 44e2b72f08aaddaeb254f920a5f9e3b82c6415be..80c2b20da2fbc29ee8058e0dc50a32c897192b7f 100644 (file)
@@ -123,7 +123,7 @@ public class NeutronFirewallPolicyNorthbound {
                     ans.add(nsg);
                 }
             }
-        } // ans.add((NeutronFirewallPolicy) rules);
+        }
         //TODO: apply pagination to results
         return Response.status(HttpURLConnection.HTTP_OK).entity(
                 new NeutronFirewallPolicyRequest(ans)).build();
index 9df65bec4fc2b3b09c75ce010097d8be866d4edf..dab5353569d433e80ed6eade5efedd17e9a04717 100644 (file)
@@ -234,7 +234,7 @@ public class NeutronFloatingIPsNorthbound {
             // if port_id is specified, then check that the port exists and has at least one IP
             String port_id = singleton.getPortUUID();
             if (port_id != null) {
-                String fixedIP = null;        // used for the fixedIP calculation
+                String fixedIP = null;
                 if (!portInterface.portExists(port_id)) {
                     throw new ResourceNotFoundException("Port UUID doesn't exist.");
                 }
@@ -374,7 +374,7 @@ public class NeutronFloatingIPsNorthbound {
         // if port_id is specified, then check that the port exists and has at least one IP
         String port_id = singleton.getPortUUID();
         if (port_id != null) {
-            String fixedIP = null;        // used for the fixedIP calculation
+            String fixedIP = null;
             if (!portInterface.portExists(port_id)) {
                 throw new ResourceNotFoundException("Port UUID doesn't exist.");
             }
index 8ae85f033ab434c786dfafb5896a179bf477bc4c..4059a6ed3f00c0091442d7720e793ed76065ad53 100644 (file)
@@ -67,8 +67,9 @@ public class NeutronNorthboundRSApplication extends Application {
         moxyJsonProvider.setValueWrapper("$");
 
         Map<String, String> namespacePrefixMapper = new HashMap<String, String>(HASHMAP_SIZE);
-        namespacePrefixMapper.put("router", "router");        // FIXME: fill in with XSD
-        namespacePrefixMapper.put("provider", "provider");    // FIXME: fill in with XSD
+        // FIXME: fill in next two with XSD
+        namespacePrefixMapper.put("router", "router");
+        namespacePrefixMapper.put("provider", "provider");
         namespacePrefixMapper.put("binding", "binding");
         moxyJsonProvider.setNamespacePrefixMapper(namespacePrefixMapper);
         moxyJsonProvider.setNamespaceSeparator(':');
index df468bb82826afc25dd316fc0f6ff6d1c54d5567..58f52898a8f15841d9bac26d4da4b8673b0317ef 100644 (file)
@@ -89,15 +89,15 @@ public abstract class AbstractNeutronInterface<T extends DataObject,S> implement
             // OK... someone didn't follow RFC 4122... lets try this the hard way
             String dedashed = uuid.replace("-", "");
             if(dedashed.length() == DEDASHED_UUID_LENGTH) {
-                String redashed = dedashed.substring(DEDASHED_UUID_START, DEDASHED_UUID_DIV1) // 8 chars
+                String redashed = dedashed.substring(DEDASHED_UUID_START, DEDASHED_UUID_DIV1)
                         + "-"
-                        + dedashed.substring(DEDASHED_UUID_DIV1, DEDASHED_UUID_DIV2) // 4 chars
+                        + dedashed.substring(DEDASHED_UUID_DIV1, DEDASHED_UUID_DIV2)
                         + "-"
-                        + dedashed.substring(DEDASHED_UUID_DIV2, DEDASHED_UUID_DIV3) // 4 chars
+                        + dedashed.substring(DEDASHED_UUID_DIV2, DEDASHED_UUID_DIV3)
                         + "-"
-                        + dedashed.substring(DEDASHED_UUID_DIV3, DEDASHED_UUID_DIV4) // 4 chars
+                        + dedashed.substring(DEDASHED_UUID_DIV3, DEDASHED_UUID_DIV4)
                         + "-"
-                        + dedashed.substring(DEDASHED_UUID_DIV4, DEDASHED_UUID_LENGTH); // 12 chars
+                        + dedashed.substring(DEDASHED_UUID_DIV4, DEDASHED_UUID_LENGTH);
                 result = new Uuid(redashed);
             } else {
                 throw e;