Merge "Inline return values"
authorSam Hague <shague@redhat.com>
Mon, 30 Nov 2015 16:29:50 +0000 (16:29 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 30 Nov 2015 16:29:50 +0000 (16:29 +0000)
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionManager.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundMapper.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/NetvirtSfcWorkaroundOF13Provider.java

index 694542463f683326b47adf230793a1268edb2119..a06f8cf91413a1ff6d461ce04e0b6f2925e956d5 100644 (file)
@@ -244,8 +244,7 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo
 
     public InstanceIdentifier<Node> getInstanceIdentifier(ConnectionInfo key) {
         ConnectionInfo connectionInfo = HwvtepSouthboundMapper.suppressLocalIpPort(key);
-        InstanceIdentifier<Node> iid = instanceIdentifiers.get(connectionInfo);
-        return iid;
+        return instanceIdentifiers.get(connectionInfo);
     }
 
     private void removeInstanceIdentifier(ConnectionInfo key) {
index 7aff3e4a437429c945d2343da0fada1d2a72c54c..a5a819c3d30001adde739a94b5f052dd1c5f4587 100644 (file)
@@ -54,11 +54,10 @@ public class HwvtepSouthboundMapper {
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) {
-        InstanceIdentifier<Node> nodePath = InstanceIdentifier
+        return InstanceIdentifier
                 .create(NetworkTopology.class)
                 .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID))
                 .child(Node.class,new NodeKey(nodeId));
-        return nodePath;
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier (OvsdbClient client) {
@@ -130,41 +129,35 @@ public class HwvtepSouthboundMapper {
     }
 
     public static InstanceIdentifier<Node> getInstanceIdentifier(Global global) {
-        InstanceIdentifier<Node> iid = null;
         String nodeString = HwvtepSouthboundConstants.HWVTEP_URI_PREFIX + "://" +
-                        HwvtepSouthboundConstants.UUID + "/" + global.getUuid().toString();
-            NodeId nodeId = new NodeId(new Uri(nodeString));
-            NodeKey nodeKey = new NodeKey(nodeId);
-            TopologyKey topoKey = new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID);
-            iid = InstanceIdentifier.builder(NetworkTopology.class)
-                            .child(Topology.class, topoKey)
-                            .child(Node.class,nodeKey)
-                            .build();
-        return iid;
+                HwvtepSouthboundConstants.UUID + "/" + global.getUuid().toString();
+        NodeId nodeId = new NodeId(new Uri(nodeString));
+        NodeKey nodeKey = new NodeKey(nodeId);
+        TopologyKey topoKey = new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID);
+        return InstanceIdentifier.builder(NetworkTopology.class)
+                .child(Topology.class, topoKey)
+                .child(Node.class, nodeKey)
+                .build();
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier(HwvtepConnectionInstance client,
                     PhysicalSwitch pSwitch) {
-        InstanceIdentifier<Node> iid = null;
         String nodeString = client.getNodeKey().getNodeId().getValue() + "/physicalswitch/" + pSwitch.getName();
         NodeId nodeId = new NodeId(new Uri(nodeString));
         NodeKey nodeKey = new NodeKey(nodeId);
-        iid =InstanceIdentifier.builder(NetworkTopology.class)
+        return InstanceIdentifier.builder(NetworkTopology.class)
                         .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID))
                         .child(Node.class, nodeKey).build();
-        return iid;
     }
 
     public static InstanceIdentifier<Node> createInstanceIdentifier(HwvtepConnectionInstance client,
                     LogicalSwitch lSwitch) {
-        InstanceIdentifier<Node> iid = null;
         String nodeString = client.getNodeKey().getNodeId().getValue() + "/logicalswitch/" + lSwitch.getName();
         NodeId nodeId = new NodeId(new Uri(nodeString));
         NodeKey nodeKey = new NodeKey(nodeId);
-        iid =InstanceIdentifier.builder(NetworkTopology.class)
+        return InstanceIdentifier.builder(NetworkTopology.class)
                         .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID))
                         .child(Node.class, nodeKey).build();
-        return iid;
     }
 
     public static Class<? extends EncapsulationTypeBase> createEncapsulationType(String type) {
index a69e801281e0794ac6c4e2f4502c8594e168e377..a474d1709377cdad67f062179bd5857607c705f9 100644 (file)
@@ -499,9 +499,7 @@ public class NetvirtSfcWorkaroundOF13Provider implements INetvirtSfcOF13Provider
     }
 
     private long getSfPort(Node bridgeNode, String sfPortName) {
-        long port = 0L;
-        port = getOFPort(bridgeNode, sfPortName);
-        return port;
+        return getOFPort(bridgeNode, sfPortName);
     }
 
     private long getOFPort(Node bridgeNode, String portName) {