clean some compilation warnings 46/77146/1
authorguillaume.lambert <guillaume.lambert@orange.com>
Mon, 3 Sep 2018 14:59:53 +0000 (16:59 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Fri, 19 Oct 2018 14:45:11 +0000 (16:45 +0200)
- remove HiddenField warnings
- remove HideUtilityClassConstructor warnings
- remove Servicehandler private constructors call from Junit tests
- remove unused imports
- remove WhitespaceAround warnings

Change-Id: Ie71482b476b2b92e91f96df36463315bf935037b
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Co-authored-by: Martial COULIBALY <martial.coulibaly@gfi.fr>
21 files changed:
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingImpl.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetConfTopologyListener.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/OrdLink.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceComplianceCheck.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceGraph.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceResult.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/validation/ServiceCreateValidation.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/validation/checks/CheckCoherencyHardSoft.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/validation/checks/ServicehandlerCompliancyCheck.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/validation/checks/ServicehandlerTxRxCheck.java
servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/impl/ServiceHandlerImplTest.java
servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/validation/ServiceCreateValidationTest.java
servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/validation/checks/ServicehandlerCompliancyCheckTest.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/SendingPceRPCs.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/impl/StubpceImpl.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/topology/InterNodePath.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/topology/NodePath.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/topology/Resource.java
tests/stubpce/src/main/java/org/opendaylight/transportpce/stubpce/topology/SuperNodePath.java

index c14d4f4f5d4be854b6358390db9afca3a66ce785..c4edf0a3dbab1f7036463ab8a2d8512bcc77a522 100644 (file)
@@ -378,14 +378,14 @@ public class PortMappingImpl implements PortMapping {
             for (Ports port : cp.getPorts()) {
                 if (Port.PortQual.XpdrNetwork.equals(port.getPortQual())) {
                     portMapList.add(createMappingObject(nodeId, port, circuitPackName,
-                        "XPDR1-"+OpenRoadmInterfacesImpl.NETWORK_TOKEN + line));
+                        "XPDR1-" + OpenRoadmInterfacesImpl.NETWORK_TOKEN + line));
                 //String lcp = port.getLogicalConnectionPoint();
                 //String regex = "XPDR[0-9]+-NETWORK[0-9]+";
                 //checkLogicalConnectionPoint(regex, lcp, nodeId, portMapList, circuitPackName, port, "NETWORK", line);
                     line++;
                 } else if (Port.PortQual.XpdrClient.equals(port.getPortQual())) {
                     portMapList.add(createMappingObject(nodeId, port, circuitPackName,
-                        "XPDR1-"+OpenRoadmInterfacesImpl.CLIENT_TOKEN + client));
+                        "XPDR1-" + OpenRoadmInterfacesImpl.CLIENT_TOKEN + client));
                 //String lcp = port.getLogicalConnectionPoint();
                 //String regex = "XPDR[0-9]+-CLIENT[0-9]+";
                 //checkLogicalConnectionPoint(regex, lcp, nodeId, portMapList, circuitPackName, port, "CLIENT", client);
index af8c10e796ce48fb8189e81af9fbd17a04306d45..5492eb5c11b3c29ec4b3066d9365bea6afb2b5d7 100644 (file)
@@ -120,7 +120,7 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
                     otuBuilder =
                     new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder(
                         intf2Delete.augmentation(
-                            org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1.class));
+                        org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1.class));
                 OtuBuilder otu = new OtuBuilder(otuBuilder.getOtu());
                 if (otu.getMaintLoopback() != null) {
                     MaintLoopbackBuilder maintLoopBackBuilder = new MaintLoopbackBuilder();
@@ -200,15 +200,14 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
         CircuitPacksBuilder cpBldr = new CircuitPacksBuilder(cp);
         boolean change = false;
         if (activate) {
-            if (cpBldr.getEquipmentState()!=null && !cpBldr.getEquipmentState().equals(States.NotReservedInuse)) {
+            if (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().equals(States.NotReservedInuse)) {
                 cpBldr.setEquipmentState(States.NotReservedInuse);
                 change = true;
             }
-        } else {
-            if ((cpBldr.getEquipmentState()!=null && !cpBldr.getEquipmentState().equals(States.NotReservedAvailable))) {
-                cpBldr.setEquipmentState(States.NotReservedAvailable);
-                change = true;
-            }
+        } else if (
+            (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().equals(States.NotReservedAvailable))) {
+            cpBldr.setEquipmentState(States.NotReservedAvailable);
+            change = true;
         }
         if (change) {
             Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(
@@ -239,4 +238,4 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
         }
     }
 
-}
\ No newline at end of file
+}
index d58b88f36693baf0f00f72d7b5a31fea4e6fbd9f..9772212e00775c6b836753ce8d8f4039b7e1deeb 100644 (file)
@@ -20,7 +20,6 @@ import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.controller.md.sal.binding.api.MountPoint;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.transportpce.common.StringConstants;
 import org.opendaylight.transportpce.common.Timeouts;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
@@ -36,9 +35,6 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.de.operations.rev161014.O
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.OrgOpenroadmDeviceListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.OrgOpenroadmLldpListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev161014.OrgOpenroadmTcaListener;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.NotificationsService;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.Netconf;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
index e0e05eea35bf16d4896312e6994690f273fa91bc..408d13adccb885eaeeb63dba1e8f319ee8249937 100644 (file)
@@ -86,4 +86,7 @@ final class OrdLink {
             return false;
         }
     }
+
+    private OrdLink(){
+    }
 }
index d4dc57b84ca18173d2f464558b7a7b9f5b68b294..86b34f2ec18d958e8ee7882e4ea4ffcc58569f34 100755 (executable)
@@ -14,7 +14,7 @@ import org.slf4j.LoggerFactory;
 /*
  * Class to check RPCs Compliancy.
  */
-public class PceComplianceCheck {
+public final class PceComplianceCheck {
 
     private static final Logger LOG = LoggerFactory.getLogger(PceComplianceCheck.class);
 
@@ -51,5 +51,8 @@ public class PceComplianceCheck {
         return new PceComplianceCheckResult(result, message);
     }
 
+    private PceComplianceCheck() {
+    }
+
 }
 
index 79e0b9c5d7829f630ac91c0ef65b9b781de22d17..3deec9d7afc993cfebd967afbf8860df0129f3cf 100644 (file)
@@ -10,13 +10,11 @@ package org.opendaylight.transportpce.pce;
 
 import edu.uci.ics.jung.algorithms.shortestpath.DijkstraShortestPath;
 import edu.uci.ics.jung.graph.DirectedSparseMultigraph;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-
 import org.apache.commons.collections15.Transformer;
 import org.opendaylight.transportpce.common.ResponseCodes;
 import org.opendaylight.transportpce.pce.PceResult.LocalCause;
@@ -448,9 +446,9 @@ public class PceGraph {
 
     }
 
-    public void setConstrains(PceConstraints pceHardConstraints, PceConstraints pceSoftConstraints) {
-        this.pceHardConstraints = pceHardConstraints;
-        this.pceSoftConstraints = pceSoftConstraints;
+    public void setConstrains(PceConstraints pceHardCons, PceConstraints pceSoftCons) {
+        this.pceHardConstraints = pceHardCons;
+        this.pceSoftConstraints = pceSoftCons;
     }
 
 }
index 8c912dad22dc6e6b2fe39b48a9579d6d6fea6218..4ee19df5a984c8ffa5dfd772c09289da6a797440 100644 (file)
@@ -86,12 +86,12 @@ public class PceResult {
         return this.ztoadirection;
     }
 
-    public void setAtoZDirection(AToZDirection atozdirection) {
-        this.atozdirection = atozdirection;
+    public void setAtoZDirection(AToZDirection atozdir) {
+        this.atozdirection = atozdir;
     }
 
-    public void setZtoADirection(ZToADirection ztoadirection) {
-        this.ztoadirection = ztoadirection;
+    public void setZtoADirection(ZToADirection ztoadir) {
+        this.ztoadirection = ztoadir;
     }
 
     public long getRate() {
index 843aebfab947dfbcf181f15188121d21c1bfc0be..a897b86f96d26df4f12d44a86e7421934a9b31d3 100644 (file)
@@ -103,7 +103,7 @@ public class PceSendingPceRPCs {
             // TODO fix. This is quick workaround for algorithm problem
             if ((rc.getLocalCause() == LocalCause.TOO_HIGH_LATENCY)
                 && (pceHardConstraints.getPceMetrics() == PceMetric.HopCount)
-                && (pceHardConstraints.getMaxLatency() != (long) -1)) {
+                && (pceHardConstraints.getMaxLatency() != -1)) {
 
                 pceHardConstraints.setPceMetrics(PceMetric.PropagationDelay);
                 graph = patchRerunGraph(graph, pceHardConstraints, pceSoftConstraints);
@@ -129,12 +129,12 @@ public class PceSendingPceRPCs {
         LOG.info("setPathDescription ...");
         AToZDirection atoz = rc.getAtoZDirection();
         ZToADirection ztoa = rc.getZtoADirection();
-        if (atoz == null || atoz.getAToZ() == null) {
+        if ((atoz == null) || (atoz.getAToZ() == null)) {
             rc.setRC("400");
             LOG.error("In pathComputation empty atoz path after description: result = {}", rc.toString());
             return;
         }
-        if (ztoa == null || ztoa.getZToA() == null) {
+        if ((ztoa == null) || (ztoa.getZToA() == null)) {
             rc.setRC("400");
             LOG.error("In pathComputation empty ztoa path after description: result = {}", rc.toString());
             return;
@@ -145,11 +145,10 @@ public class PceSendingPceRPCs {
         LOG.info("In pathComputation Graph is Found");
     }
 
-    private PceGraph patchRerunGraph(PceGraph graph, PceConstraints pceHardConstraints,
-        PceConstraints pceSoftConstraints) {
+    private PceGraph patchRerunGraph(PceGraph graph, PceConstraints pceHardCons, PceConstraints pceSoftCons) {
 
         LOG.info("In pathComputation patchRerunGraph : rerun Graph with metric = PROPAGATION-DELAY ");
-        graph.setConstrains(pceHardConstraints, pceSoftConstraints);
+        graph.setConstrains(pceHardCons, pceSoftCons);
         graph.calcPath();
         return graph;
 
index 68f1f2b6593b976e34dd4a72d5eb6104262e15f7..6d962aea0dcfdaa0ff12044ef150739cd985cfce 100644 (file)
@@ -90,7 +90,7 @@ public final class ServiceCreateValidation {
         return OperationResult.ok("Validation successful.");
     }
 
-    public ServiceCreateValidation() {
+    private ServiceCreateValidation() {
     }
 
 }
index f3c015a0446dce3f76cbbda2fd5717599f05c738..828bc3c088a7f10970896605a7dc13a4b4228274 100644 (file)
@@ -44,7 +44,7 @@ public final class CheckCoherencyHardSoft {
         return result;
     }
 
-    public CheckCoherencyHardSoft() {
+    private CheckCoherencyHardSoft() {
     }
 
 }
index 0ee2ba8f701a9d4e97a320df1cf3f0a895996af6..24432ae577786d0520984722e47f7f81d3f9a37d 100644 (file)
@@ -90,7 +90,7 @@ public final class ServicehandlerCompliancyCheck {
         return new ComplianceCheckResult(result, message);
     }
 
-    public ServicehandlerCompliancyCheck() {
+    private ServicehandlerCompliancyCheck() {
     }
 
 }
index e55cf5cdc7fe8cb6e7e27de797f0a305c1e3d071..b7a23d93858a0495972cf0b0f55a50cceb9307b0 100644 (file)
@@ -170,7 +170,7 @@ public final class ServicehandlerTxRxCheck {
         return new ComplianceCheckResult(result, message);
     }
 
-    public ServicehandlerTxRxCheck() {
+    private ServicehandlerTxRxCheck() {
     }
 
 }
index 104d1713cb6c1c86ec082f47be466ab3c3abb7e2..2f81fc1f04eeb2940c6ec72d45671aa0eaa9f2d4 100644 (file)
@@ -451,7 +451,7 @@ public class ServiceHandlerImplTest extends AbstractTest {
         txDirectionBuilder.setLgx(lgx);
         serviceAEndBuilder.setTxDirection(txDirectionBuilder.build());
         ServiceCreateInputBuilder buildInput = new ServiceCreateInputBuilder(serviceCreateInput);
-        ServicehandlerImpl serviceHandler = new ServicehandlerImpl(getDataBroker(), this.pathComputationService, null);
+        this.serviceHandler = new ServicehandlerImpl(getDataBroker(), this.pathComputationService, null);
         return serviceHandler.serviceCreate(buildInput.setServiceAEnd(serviceAEndBuilder.build()).build()).get()
                 .getResult();
     }
@@ -734,7 +734,7 @@ public class ServiceHandlerImplTest extends AbstractTest {
         rxDirectionBuilder.setLgx(lgx);
         serviceAEndBuilder.setRxDirection(rxDirectionBuilder.build());
         ServiceCreateInputBuilder buildInput = new ServiceCreateInputBuilder(serviceCreateInput);
-        ServicehandlerImpl serviceHandler = new ServicehandlerImpl(getDataBroker(), this.pathComputationService, null);
+        this.serviceHandler = new ServicehandlerImpl(getDataBroker(), this.pathComputationService, null);
         return serviceHandler.serviceCreate(buildInput.setServiceAEnd(serviceAEndBuilder.build()).build()).get()
                 .getResult();
     }
index 5ec1362dc191b46dfd70f7edc0f3d2030b585fff..06958d2049ba6e887c3fe451365a17095846ae6b 100644 (file)
@@ -12,8 +12,6 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.transportpce.common.OperationResult;
 import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
-import org.opendaylight.transportpce.servicehandler.validation.checks.CheckCoherencyHardSoft;
-import org.opendaylight.transportpce.servicehandler.validation.checks.ServicehandlerTxRxCheck;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.CoRoutingBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraintsBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraintsBuilder;
@@ -94,22 +92,4 @@ public class ServiceCreateValidationTest {
         OperationResult result = ServiceCreateValidation.validateServiceCreateRequest(input);
         Assert.assertEquals(true, result.isSuccess());
     }
-
-    @Test
-    public void constructServicehandlerTxRxCheck() {
-        ServicehandlerTxRxCheck servicehandlerTxRxCheck = new ServicehandlerTxRxCheck();
-        Assert.assertEquals(ServicehandlerTxRxCheck.class, servicehandlerTxRxCheck.getClass());
-    }
-
-    @Test
-    public void constructCheckCoherencyHardSoft() {
-        CheckCoherencyHardSoft checkCoherencyHardSoft = new  CheckCoherencyHardSoft();
-        Assert.assertEquals(CheckCoherencyHardSoft.class, checkCoherencyHardSoft.getClass());
-    }
-
-    @Test
-    public void constructServiceCreateValidation() {
-        ServiceCreateValidation serviceCreateValidation = new  ServiceCreateValidation();
-        Assert.assertEquals(ServiceCreateValidation.class, serviceCreateValidation.getClass());
-    }
 }
index 1ea15d6241194a8f2326c270bef7096fede27bc7..3c9c0aac3758999dc08e900099979bba8977e8ea 100644 (file)
@@ -28,10 +28,4 @@ public class ServicehandlerCompliancyCheckTest {
         Assert.assertEquals("", result.getMessage());
         Assert.assertEquals(true, result.hasPassed());
     }
-
-    @Test
-    public void constructServicehandlerCompliancyCheck() {
-        ServicehandlerCompliancyCheck servicehandlerCompliancyCheck = new ServicehandlerCompliancyCheck();
-        Assert.assertEquals(ServicehandlerCompliancyCheck.class, servicehandlerCompliancyCheck.getClass());
-    }
 }
index 2f2137d963f461f232ef91082c5c7af913aa0a66..4d5b153d14648b7a2f0b846f870646cd474c1d96 100644 (file)
@@ -13,7 +13,6 @@ import com.google.common.base.Optional;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
-
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -24,7 +23,6 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
-
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
@@ -120,8 +118,8 @@ public class SendingPceRPCs {
      */
     private Boolean comp(Resource pathAend, Resource pathZend, String inputAend, String inputZend) {
         Boolean result = false;
-        if (pathAend != null && pathZend != null && inputAend != null && inputZend != null) {
-            if (pathAend instanceof Node && pathZend instanceof Node) {
+        if ((pathAend != null) && (pathZend != null) && (inputAend != null) && (inputZend != null)) {
+            if ((pathAend instanceof Node) && (pathZend instanceof Node)) {
                 Node aend = (Node) pathAend;
                 Node zend = (Node) pathZend;
                 if (aend.getNodeIdentifier().getNodeId().compareToIgnoreCase(inputAend) == 0) {
@@ -146,7 +144,7 @@ public class SendingPceRPCs {
         Boolean result = false;
         LOG.info("{} - {}", res1.getClass().getName(), res2.getClass().getName());
         if (res1.getClass().getName().compareToIgnoreCase(res2.getClass().getName()) == 0) {
-            if (res1 instanceof Node && res2 instanceof Node) {
+            if ((res1 instanceof Node) && (res2 instanceof Node)) {
                 Node node1 = (Node)res1;
                 Node node2 = (Node)res2;
                 if (node1.getNodeIdentifier().getNodeId()
@@ -154,7 +152,7 @@ public class SendingPceRPCs {
                     result = true;
                 }
             }
-            if (res1 instanceof TerminationPoint && res2 instanceof TerminationPoint) {
+            if ((res1 instanceof TerminationPoint) && (res2 instanceof TerminationPoint)) {
                 TerminationPoint tp1 = (TerminationPoint)res1;
                 TerminationPoint tp2 = (TerminationPoint)res2;
                 if (tp1.getTerminationPointIdentifier().getNodeId()
@@ -165,7 +163,7 @@ public class SendingPceRPCs {
                     }
                 }
             }
-            if (res1 instanceof Link && res2 instanceof Link) {
+            if ((res1 instanceof Link) && (res2 instanceof Link)) {
                 Link link1 = (Link)res1;
                 Link link2 = (Link)res2;
                 if (link1.getLinkIdentifier().getLinkId().compareTo(link2.getLinkIdentifier().getLinkId()) == 0) {
@@ -203,7 +201,7 @@ public class SendingPceRPCs {
                     Boolean trouve = false;
                     for (int loop = 0;loop < size;loop++) {
                         id2 = atoz2.getAToZ().get(loop).getId();
-                        if (id2 != null && id2.compareTo(id1) == 0) {
+                        if ((id2 != null) && (id2.compareTo(id1) == 0)) {
                             res2 = atoz2.getAToZ().get(loop).getResource().getResource();
                             LOG.info("res2 : {}", res2.toString());
                             trouve = true;
@@ -255,7 +253,7 @@ public class SendingPceRPCs {
                     Boolean trouve = false;
                     for (int loop = 0;loop < size;loop++) {
                         id2 = ztoa2.getZToA().get(loop).getId();
-                        if (id2 != null && id2.compareTo(id1) == 0) {
+                        if ((id2 != null) && (id2.compareTo(id1) == 0)) {
                             res2 = ztoa2.getZToA().get(loop).getResource().getResource();
                             LOG.info("res2 : {}", res2.toString());
                             trouve = true;
@@ -291,14 +289,14 @@ public class SendingPceRPCs {
     private Boolean excludeNode(PathDescriptions path, List<String> nodes) {
         LOG.info("Testing exclude Nodes ...");
         Boolean result = false;
-        if (path != null && !nodes.isEmpty()) {
+        if ((path != null) && !nodes.isEmpty()) {
             List<AToZ> list = path.getAToZDirection().getAToZ();
             if (!list.isEmpty()) {
                 int index = 0;
                 boolean found = false;
-                while (index < list.size() && !found) {
+                while ((index < list.size()) && !found) {
                     Resource res = list.get(index).getResource().getResource();
-                    if (res != null && res instanceof Node) {
+                    if ((res != null) && (res instanceof Node)) {
                         Node node = (Node) res;
                         for (String exclude : nodes) {
                             if (exclude.compareToIgnoreCase(node.getNodeIdentifier().getNodeId()) == 0) {
@@ -333,14 +331,14 @@ public class SendingPceRPCs {
     private Boolean diversityService(List<String> existingService, PathDescriptions path, int choice) {
         LOG.info("Testing diversity ...");
         Boolean result = false;
-        if (path != null && choice >= 0 && !existingService.isEmpty()) {
+        if ((path != null) && (choice >= 0) && !existingService.isEmpty()) {
             int index = 0;
             while (index < existingService.size()) {
                 String tmp = existingService.get(index);
                 if (tmp != null) {
                     org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service
                         .types.rev170426.service.path.PathDescription pathDesc = null;
-                    if (servicePathList != null && !servicePathList.isEmpty()) {
+                    if ((servicePathList != null) && !servicePathList.isEmpty()) {
                         for (ServicePaths service : servicePathList) {
                             if (service.getServicePathName().compareTo(tmp) == 0) {
                                 LOG.info("Existing Service '{}' found in ServicePathList ...", tmp);
@@ -403,9 +401,9 @@ public class SendingPceRPCs {
                         org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service
                             .types.rev170426.service.path.PathDescription tmp = service.getPathDescription();
                         if (tmp != null) {
-                            if (path.getAToZDirection() != null && tmp.getAToZDirection() != null
+                            if ((path.getAToZDirection() != null) && (tmp.getAToZDirection() != null)
                                     && egalAtoZDirection(path.getAToZDirection(), tmp.getAToZDirection())) {
-                                if (path.getZToADirection() != null && tmp.getZToADirection() != null
+                                if ((path.getZToADirection() != null) && (tmp.getZToADirection() != null)
                                         && egalZtoADirection(path.getZToADirection(), tmp.getZToADirection())) {
                                     result = true;
                                     LOG.info("Path already present in servicePath List");
@@ -446,7 +444,7 @@ public class SendingPceRPCs {
     private List<PathDescriptions> retrievePath(String aendNodeId, String zendNodeId) {
         List<PathDescriptions> result = new ArrayList<PathDescriptions>();
         List<PathDescriptions> paths = readPathDescriptionList();
-        if (!paths.isEmpty() && aendNodeId != null && zendNodeId != null) {
+        if (!paths.isEmpty() && (aendNodeId != null) && (zendNodeId != null)) {
             LOG.info("retrieving paths from pathDescription List for {} / {}", aendNodeId, zendNodeId);
             for (PathDescriptions tmp : paths) {
                 Resource pathAend = null;
@@ -479,7 +477,7 @@ public class SendingPceRPCs {
                         }
                         index++;
                     }
-                    if (pathAend != null && pathZend != null) {
+                    if ((pathAend != null) && (pathZend != null)) {
                         LOG.info("pathAend : {} - pathZend: {}",pathAend, pathZend);
                         LOG.info("aendNodeId : {} - zendNodeId : {}", aendNodeId, zendNodeId);
                         if (comp(pathAend, pathZend, aendNodeId, zendNodeId)) {
@@ -510,7 +508,7 @@ public class SendingPceRPCs {
             PathDescriptions path = it.next();
             String name = path.getPathName();
             LOG.info("path  : {}", name);
-            if (name != null && name.contains(contain)) {
+            if ((name != null) && name.contains(contain)) {
                 LOG.info("    path gets : {}", name);
                 String [] split = name.split("_");
                 if (split.length == 3) {
@@ -577,7 +575,7 @@ public class SendingPceRPCs {
                 if (cancelInput != null) {
                     Boolean found = false;
                     String name = cancelInput.getServiceName();
-                    if (name != null && !servicePathList.isEmpty()) {
+                    if ((name != null) && !servicePathList.isEmpty()) {
                         for (ServicePaths service : servicePathList) {
                             if (name.compareTo(service.getServicePathName()) == 0) {
                                 LOG.info("ServicePaths found in ServicePathList !!!");
@@ -620,7 +618,7 @@ public class SendingPceRPCs {
                 if (input != null) {
                     HardConstraints inputHard = input.getHardConstraints();
                     SoftConstraints inputSoft = input.getSoftConstraints();
-                    if (inputHard != null || inputSoft != null) {
+                    if ((inputHard != null) || (inputSoft != null)) {
                         constraints = true;
                     }
                     path = null;
@@ -649,17 +647,17 @@ public class SendingPceRPCs {
                                             if (existingService.size() > 0) {
                                                 LOG.info("Getting existing service applicability ...");
                                                 int choice = -1;
-                                                if (choice < 0
+                                                if ((choice < 0)
                                                         && diversity.getExistingServiceApplicability().isNode()) {
                                                     LOG.info("existing-service-applicability : Node");
                                                     choice = 0;
                                                 }
-                                                if (choice < 0
+                                                if ((choice < 0)
                                                         && diversity.getExistingServiceApplicability().isClli()) {
                                                     LOG.info("existing-service-applicability : Clli");
                                                     choice = 1;
                                                 }
-                                                if (choice < 0
+                                                if ((choice < 0)
                                                         && diversity.getExistingServiceApplicability().isSrlg()) {
                                                     LOG.info("existing-service-applicability : Srlg");
                                                     choice = 2;
@@ -776,7 +774,7 @@ public class SendingPceRPCs {
      */
     private Boolean writeOrDeleteServicePathList(String serviceName, int choice) {
         Boolean result = null;
-        if (serviceName != null && serviceName.compareTo(" ") != 0 && choice >= 0 && choice < 2) {
+        if ((serviceName != null) && (serviceName.compareTo(" ") != 0) && (choice >= 0) && (choice < 2)) {
             LOG.info("WriteOrDeleting '{}' ServicePaths", serviceName);
             WriteTransaction writeTx = db.newWriteOnlyTransaction();
             result = true;
@@ -875,16 +873,16 @@ public class SendingPceRPCs {
         return input;
     }
 
-    public void setInput(PathComputationRequestInput input) {
-        this.input = input;
+    public void setInput(PathComputationRequestInput pathComputationRequestInput) {
+        this.input = pathComputationRequestInput;
     }
 
     public CancelResourceReserveInput getCancelInput() {
         return cancelInput;
     }
 
-    public void setCancelInput(CancelResourceReserveInput input) {
-        this.cancelInput = input;
+    public void setCancelInput(CancelResourceReserveInput cancelResourceReserveInput) {
+        this.cancelInput = cancelResourceReserveInput;
     }
 
     public DataBroker getDb() {
index a02ca4d5acc6c6f9911c19c4df1d9b7333bc7f36..6240693e29e18d0e2a060422ef2defe3ae2ddd22 100644 (file)
@@ -365,10 +365,10 @@ public class StubpceImpl implements StubpceService {
      * @param DataBroker
      *            Access DataStore
      */
-    private boolean initializePathDescriptionList(DataBroker db) {
+    private boolean initializePathDescriptionList(DataBroker dataBroker) {
         Boolean result = true;
         LOG.info("Preparing to initialize the PathDescription List");
-        WriteTransaction transaction = db.newWriteOnlyTransaction();
+        WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
         InstanceIdentifier<PathDescriptionList> iid = InstanceIdentifier.create(PathDescriptionList.class);
         PathDescriptionList pathDescriptionList = new PathDescriptionListBuilder().build();
         transaction.put(LogicalDatastoreType.OPERATIONAL, iid, pathDescriptionList);
@@ -389,10 +389,10 @@ public class StubpceImpl implements StubpceService {
      *            Access DataStore
      * @return <code>true</code> if ok, <code>false</code> else
      */
-    private boolean initializeServicePathList(DataBroker db) {
+    private boolean initializeServicePathList(DataBroker dataBroker) {
         Boolean result = true;
         LOG.info("Preparing to initialize the ServicePathList registry");
-        WriteTransaction transaction = db.newWriteOnlyTransaction();
+        WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
         InstanceIdentifier<ServicePathList> iid = InstanceIdentifier.create(ServicePathList.class);
         ServicePathList servicePathList = new ServicePathListBuilder().build();
         transaction.put(LogicalDatastoreType.OPERATIONAL, iid, servicePathList);
index 0df5603c54060196c03e92f888d09586ff3c29cb..861bc84c13be5ba36c017e4e959e0f32a247453a 100644 (file)
@@ -74,8 +74,8 @@ public class InterNodePath {
         for (Path path : paths) {
             tpNodeTp = path.getTpNodeTp();
             tpNodeTp.createAToZListHop(order);
-            for (AToZ atoz : tpNodeTp.getAToZ()) {
-                atozList.add(atoz);
+            for (AToZ tmp : tpNodeTp.getAToZ()) {
+                atozList.add(tmp);
                 order++;
             }
             Link link = path.getLink();
@@ -102,8 +102,8 @@ public class InterNodePath {
         for (Path path : paths) {
             tpNodeTp = path.getTpNodeTp();
             tpNodeTp.createZToAListHop(order);
-            for (ZToA ztoa : tpNodeTp.getZToA()) {
-                ztoaList.add(ztoa);
+            for (ZToA tmp : tpNodeTp.getZToA()) {
+                ztoaList.add(tmp);
                 order++;
             }
             Link link = path.getLink();
@@ -350,9 +350,9 @@ public class InterNodePath {
                 String id = Integer.toString(size - index);
                 org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription
                     .rev170426.pce.resource.resource.Resource res = null;
-                for (AToZ atoz : atozList) {
-                    if (atoz.getId().compareTo(id) == 0) {
-                        res = atoz.getResource().getResource();
+                for (AToZ tmpAtoz : atozList) {
+                    if (tmpAtoz.getId().compareTo(id) == 0) {
+                        res = tmpAtoz.getResource().getResource();
                         if (res != null) {
 
                             switch (index) {
@@ -420,17 +420,17 @@ public class InterNodePath {
                 if (size > 0) {
                     String id = Integer.toString(size - 1);
                     for (ListIterator<AToZ> it = atozList.listIterator(); it.hasNext();) {
-                        AToZ atoz = it.next();
-                        if (atoz.getId().compareTo(id) == 0) {
+                        AToZ tmpAtoz = it.next();
+                        if (tmpAtoz.getId().compareTo(id) == 0) {
                             org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription
-                                .rev170426.pce.resource.resource.Resource res = atoz.getResource().getResource();
+                                .rev170426.pce.resource.resource.Resource res = tmpAtoz.getResource().getResource();
                             if ((res != null)  && (res instanceof Link)) {
                                 Link link = new LinkBuilder()
                                         .setLinkIdentifier(new LinkIdentifierBuilder()
                                                 .setLinkId(atozLink)
                                                 .build())
                                         .build();
-                                AToZKey atozKey = new AToZKey(atoz.key());
+                                AToZKey atozKey = new AToZKey(tmpAtoz.key());
                                 org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
                                     .pathdescription.rev170426.pce.resource.Resource resource = new ResourceBuilder()
                                     .setResource(link).build();
@@ -468,10 +468,10 @@ public class InterNodePath {
             int size = atozList.size();
             if (size > 0) {
                 String id = Integer.toString(0);
-                for (AToZ atoz : atozList) {
-                    if (atoz.getId().compareTo(id) == 0) {
+                for (AToZ tmpAtoz : atozList) {
+                    if (tmpAtoz.getId().compareTo(id) == 0) {
                         org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription
-                            .rev170426.pce.resource.resource.Resource res = atoz.getResource().getResource();
+                            .rev170426.pce.resource.resource.Resource res = tmpAtoz.getResource().getResource();
                         if ((res != null)  && (res instanceof TerminationPoint)) {
                             TerminationPoint tp = (TerminationPoint) res;
                             if ((tp != null) && tp.getTerminationPointIdentifier().getTpId().contains(beginBy)) {
index e8da8c2cf08e69d36889499162a0160735a340de..61ea6688652bcc6a22defd362e641c4c8eca76b7 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.transportpce.stubpce.topology;
 
 import java.util.ArrayList;
 import java.util.List;
-
 import org.apache.commons.lang3.StringUtils;
 import org.opendaylight.transportpce.stubpce.TpNodeTp;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.Link;
@@ -371,7 +370,7 @@ public class NodePath {
         return isXpdrSrgAbsent;
     }
 
-    public void setXpdrSrgAbsent(boolean isXpdrSrgAbsent) {
-        this.isXpdrSrgAbsent = isXpdrSrgAbsent;
+    public void setXpdrSrgAbsent(boolean xpdrSrgAbsent) {
+        this.isXpdrSrgAbsent = xpdrSrgAbsent;
     }
 }
index 141cae4c85358703a34a6dc9be4fd48b5ff83fae..47d2dff9db42c4abb64a5ba7e556a1232dbc8464 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.transportpce.stubpce.topology;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-
 import java.util.List;
 
 
@@ -72,8 +71,8 @@ public class Resource {
         return lcps;
     }
 
-    public void setLpcs(List<LogicalConnectionPoint> lcps) {
-        this.lcps = lcps;
+    public void setLpcs(List<LogicalConnectionPoint> logicalConPoints) {
+        this.lcps = logicalConPoints;
     }
 
     @Override
index 5c8e66ab3e579d3b209d1c1e643be9714b48be0b..55bfa81af55af69978635006091434e181bc9185 100644 (file)
@@ -567,13 +567,14 @@ public class SuperNodePath {
      * @param paths NodeLinkNode list paths
      * @return PathDescriptionsOrdered List of direct paths
      */
-    public SortedSet<PathDescriptionsOrdered> getDirectPathDesc(String aend, String zend,List<NodeLinkNode> paths) {
+    public SortedSet<PathDescriptionsOrdered> getDirectPathDesc(String aend, String zend,
+            List<NodeLinkNode> nodeLinkNodes) {
         List<AToZDirection> atozdirectionPaths = new ArrayList<AToZDirection>();
         SortedSet<PathDescriptionsOrdered> result = new TreeSet<PathDescriptionsOrdered>();
         SuperNode aendSp = getSuperNode(aend);
         SuperNode zendSp = getSuperNode(zend);
-        if (!paths.isEmpty()) {
-            for (NodeLinkNode tmp : paths) {
+        if (!nodeLinkNodes.isEmpty()) {
+            for (NodeLinkNode tmp : nodeLinkNodes) {
                 if (tmp.getDirect()) {
                     LOG.info("Direct NodeLinkNode : {}", tmp.toString());
                     String atozLink = null;
@@ -630,13 +631,14 @@ public class SuperNodePath {
      * @param paths NodeLinkNode list paths
      * @return PathDescriptionsOrdered List of indirect paths
      */
-    public SortedSet<PathDescriptionsOrdered> getIndirectPathDesc(String aend, String zend,List<NodeLinkNode> paths) {
+    public SortedSet<PathDescriptionsOrdered> getIndirectPathDesc(String aend, String zend,
+            List<NodeLinkNode> nodeLinkNodes) {
         List<AToZDirection> atozdirectionPaths = new ArrayList<AToZDirection>();
         SortedSet<PathDescriptionsOrdered> result = new TreeSet<PathDescriptionsOrdered>();
         SuperNode aendSp = getSuperNode(aend);
         SuperNode zendSp = getSuperNode(zend);
-        if (!paths.isEmpty()) {
-            for (NodeLinkNode tmp : paths) {
+        if (!nodeLinkNodes.isEmpty()) {
+            for (NodeLinkNode tmp : nodeLinkNodes) {
                 if (!tmp.getDirect()) {
                     LOG.info("Indirect NodeLinkNode : {}", tmp.toString());
                     int size = tmp.getAtozLink().size();