Fix some SpotBugs issues 75/87675/8
authorguillaume.lambert <guillaume.lambert@orange.com>
Thu, 13 Feb 2020 16:00:09 +0000 (17:00 +0100)
committerguillaume.lambert <guillaume.lambert@orange.com>
Sat, 15 Feb 2020 12:41:56 +0000 (13:41 +0100)
JIRA: TRNSPRTPCE-198
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I14e7ef94a94036af7e5fb2725f9116c52dc23476

42 files changed:
common/src/main/java/org/opendaylight/transportpce/common/DataStoreContextImpl.java
common/src/main/java/org/opendaylight/transportpce/common/converter/AbstractDataObjectConverter.java
common/src/main/java/org/opendaylight/transportpce/common/converter/JSONDataObjectConverter.java
common/src/main/java/org/opendaylight/transportpce/common/converter/XMLDataObjectConverter.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl121.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl221.java
common/src/main/java/org/opendaylight/transportpce/common/device/DeviceTransaction.java
common/src/main/java/org/opendaylight/transportpce/common/device/DeviceTransactionManagerImpl.java
common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion121.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion221.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl221.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/NetConfTopologyListener.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/R2RLinkDiscovery.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/listeners/AlarmNotificationListener.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/listeners/AlarmNotificationListener221.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmOtnTopology.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/OpenRoadmTopology.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/util/TopologyUtils.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtImpl.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion121.java
olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtVersion221.java
olm/src/main/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/constraints/PceConstraintsCalc.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyResult.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyServiceImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyTopoImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ServiceDataStoreOperationsImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceCalculation.java
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceLink.java
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNode.java
pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/ModelMappingUtils.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/tasks/OlmPowerSetupRollbackTask.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/rpcs/TransportPCEServicePathRPCImpl.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubPceServiceOperations.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/stub/StubRendererServiceOperations.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiUtils.java
tapi/src/main/java/org/opendaylight/transportpce/tapi/validation/CreateConnectivityServiceValidation.java

index 56f6099d5a604e75230ad8585f8587d8891c5199..6335ed85b5fc416b9ac1b93ed9e2dfb4bc433521 100644 (file)
@@ -150,7 +150,7 @@ public class DataStoreContextImpl implements DataStoreContext {
         return store;
     }
 
-    private final class SchemaContextHolder implements DOMSchemaService, SchemaContextProvider {
+    private static final class SchemaContextHolder implements DOMSchemaService, SchemaContextProvider {
 
         private final SchemaContext schemaContext;
         private final ListenerRegistry<SchemaContextListener> listeners;
index 924dad513e5450bdce0c4b4219ad164ef13a61bd..3a003b011316cc8f60015d5f7d17cc62becc4500 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.transportpce.common.converter;
 
-import com.google.common.base.Preconditions;
+//import com.google.common.base.Preconditions;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Optional;
@@ -75,7 +75,7 @@ public abstract class AbstractDataObjectConverter implements DataObjectConverter
     public <T extends DataObject> Optional<T> getDataObject(
             @Nonnull NormalizedNode<?, ?> normalizedNode,
             @Nonnull QName rootNode) {
-        Preconditions.checkNotNull(normalizedNode);
+        //Preconditions.checkNotNull(normalizedNode);
         if (normalizedNode instanceof ContainerNode) {
             YangInstanceIdentifier.PathArgument directChildIdentifier =
                     YangInstanceIdentifier.of(rootNode).getLastPathArgument();
index 74a6a1c64e7d35cb7c0b3ed8e10937866b1fe73d..9ee94196158e806f83c991564ac805abd6fbd88e 100644 (file)
@@ -81,7 +81,7 @@ public final class JSONDataObjectConverter extends AbstractDataObjectConverter {
             JsonReader reader = new JsonReader(new InputStreamReader(inputStream, "UTF-8"));
             return parseInputJSON(reader);
         } catch (IOException e) {
-            LOG.warn(e.getMessage(), e);
+            LOG.warn("IOException {}",e.getMessage());
             return Optional.empty();
         }
     }
@@ -140,7 +140,7 @@ public final class JSONDataObjectConverter extends AbstractDataObjectConverter {
                 getSchemaContext())) {
             jsonParser.parse(reader);
         } catch (IOException e) {
-            LOG.warn("An error {} occured during parsing Json input stream", e.getMessage(), e);
+            LOG.warn("An error occured during parsing Json input stream", e);
             return Optional.empty();
         }
         return Optional.ofNullable(result.getResult());
index a83fa3787111cd5b23abdb079762c7f0172e5c79..afcccda9a791db013fbe769ef8bfce6e40da72a0 100644 (file)
@@ -100,7 +100,7 @@ public final class XMLDataObjectConverter extends AbstractDataObjectConverter {
             XMLStreamReader reader = this.xmlInputFactory.createXMLStreamReader(inputStream);
             return parseInputXML(reader);
         } catch (XMLStreamException e) {
-            LOG.warn(e.getMessage(), e);
+            LOG.warn("XMLStreamException: {}", e.getMessage());
             return Optional.empty();
         }
     }
@@ -111,7 +111,7 @@ public final class XMLDataObjectConverter extends AbstractDataObjectConverter {
             XMLStreamReader reader = this.xmlInputFactory.createXMLStreamReader(inputReader);
             return parseInputXML(reader, parentSchema);
         } catch (XMLStreamException e) {
-            LOG.warn(e.getMessage(), e);
+            LOG.warn("XMLStreamException: {}", e.getMessage());
             return Optional.empty();
         }
     }
@@ -129,7 +129,7 @@ public final class XMLDataObjectConverter extends AbstractDataObjectConverter {
             XMLStreamReader reader = this.xmlInputFactory.createXMLStreamReader(inputReader);
             return parseInputXML(reader);
         } catch (XMLStreamException e) {
-            LOG.warn(e.getMessage(), e);
+            LOG.warn("XMLStreamException: {}", e.getMessage());
             return Optional.empty();
         }
     }
@@ -195,7 +195,7 @@ public final class XMLDataObjectConverter extends AbstractDataObjectConverter {
              XmlParserStream xmlParser = XmlParserStream.create(streamWriter, getSchemaContext(), parentSchemaNode)) {
             xmlParser.parse(reader);
         } catch (XMLStreamException | URISyntaxException | IOException | SAXException e) {
-            LOG.warn("An error {} occured during parsing XML input stream", e.getMessage(), e);
+            LOG.warn("An error occured during parsing XML input stream", e);
             return Optional.empty();
         }
         return Optional.ofNullable(result.getResult());
@@ -234,7 +234,7 @@ public final class XMLDataObjectConverter extends AbstractDataObjectConverter {
             factory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
             xmlStreamWriter = factory.createXMLStreamWriter(backingWriter);
         } catch (XMLStreamException | FactoryConfigurationError e) {
-            LOG.error("Error [{}] while creating XML writer", e.getMessage(), e);
+            LOG.error("Error while creating XML writer: ", e);
             throw new IllegalStateException(e);
         }
         return xmlStreamWriter;
index 463dabd9456473376f3d493f38a4ebdcc1b41628..8ec33c505bf1666545416946cdc241becbb7c90c 100644 (file)
@@ -47,7 +47,7 @@ public class CrossConnectImpl implements CrossConnect {
         else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2_1)) {
             return crossConnectImpl221.getCrossConnect(nodeId,connectionNumber);
         }
-        return null;
+        return Optional.empty();
     }
 
 
@@ -63,7 +63,7 @@ public class CrossConnectImpl implements CrossConnect {
             return crossConnectImpl221.postCrossConnect(nodeId, waveNumber, srcTp, destTp);
         }
         LOG.info("Device Version not found");
-        return null;
+        return Optional.empty();
 
     }
 
index 99843bd081c1ad4e03b51a5a8418a0234c123f40..83133b16eaf4316141bb127e88d5c3946ba48360 100644 (file)
@@ -91,7 +91,7 @@ public class CrossConnectImpl121 {
             LOG.info("Roadm-connection successfully created: {}-{}-{}", srcTp, destTp, waveNumber);
             return Optional.of(connectionNumber);
         } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Failed to post {}. Exception: {}", rdmConnBldr.build(), e);
+            LOG.warn("Failed to post {}. Exception: ", rdmConnBldr.build(), e);
         }
         return Optional.empty();
     }
@@ -193,8 +193,8 @@ public class CrossConnectImpl121 {
 
         Optional<RoadmConnections> rdmConnOpt = getCrossConnect(deviceId, connectionNumber);
         if (rdmConnOpt.isPresent()) {
-            RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder(rdmConnOpt.get());
-            rdmConnBldr.setOpticalControlMode(OpticalControlMode.class.cast(mode));
+            RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder(rdmConnOpt.get())
+                    .setOpticalControlMode(OpticalControlMode.class.cast(mode));
             if (powerValue != null) {
                 rdmConnBldr.setTargetOutputPower(new PowerDBm(powerValue));
             }
index 6e189c443bb35ea82cdc856f9736f7d16c9b36da..bbe54cea8dfdcec944e2567ad78de0705a8bd14d 100644 (file)
@@ -98,7 +98,7 @@ public class CrossConnectImpl221 {
             LOG.info("Roadm-connection successfully created: {}-{}-{}", srcTp, destTp, waveNumber);
             return Optional.of(connectionNumber);
         } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Failed to post {}. Exception: {}", rdmConnBldr.build(), e);
+            LOG.warn("Failed to post {}. Exception: ", rdmConnBldr.build(), e);
         }
         return Optional.empty();
     }
@@ -109,8 +109,7 @@ public class CrossConnectImpl221 {
         Optional<RoadmConnections> xc = getCrossConnect(deviceId, connectionName);
         //Check if cross connect exists before delete
         if (xc.isPresent()) {
-            String name = xc.get().getSource().getSrcIf();
-            name.replace("nmc", "mc");
+            String name = xc.get().getSource().getSrcIf().replace("nmc", "mc");
             interfList.add(xc.get().getSource().getSrcIf());
             interfList.add(xc.get().getDestination().getDstIf());
             interfList.add(xc.get().getSource().getSrcIf().replace("nmc", "mc"));
index b968d79738dfd23fc4c9ef365a58e736e182354a..e4232ff535dcb06c0bb4ea9cb6c49088f89e0347 100644 (file)
@@ -122,7 +122,7 @@ public class DeviceTransaction {
         future.addCallback(new FutureCallback<CommitInfo>() {
             @Override
             public void onSuccess(@Nullable CommitInfo result) {
-                LOG.debug("Transaction with lock {} successfully committed:", deviceLock, result);
+                LOG.debug("Transaction with lock {} successfully committed: {}", deviceLock, result);
                 afterClose();
             }
 
index 9cf55957133e6dc152afdeeff6a30532864656d3..6f424f511d9bfdb23a92129179c7db2c7cf76651 100644 (file)
@@ -106,9 +106,9 @@ public class DeviceTransactionManagerImpl implements DeviceTransactionManager {
                         LOG.debug("Timeout to submit transaction run out! Transaction was {} submitted or canceled.",
                                 deviceTx.wasSubmittedOrCancelled().get() ? "" : "not");
                         if (!deviceTx.wasSubmittedOrCancelled().get()) {
-                            LOG.error(String.format("Transaction for node %s was not submitted or canceled after %s"
-                                            + " milliseconds! Cancelling transaction!", deviceId,
-                                    timeoutToSubmit));
+                            LOG.error(
+                                "Transaction for node {} not submitted/canceled after {} ms. Cancelling transaction.",
+                                deviceId, timeoutToSubmit);
                             deviceTx.cancel();
                         }
                     }
index 9b4e3b1457e1e6166cc70c51548bb6a8b6de964b..0059747ea7947400d49883dc3b8b9b3f61f2d27a 100644 (file)
@@ -16,10 +16,10 @@ public final class FixedFlexImpl implements FixedFlexInterface {
     private double wavelength;
     // wavelengthSpacing is in GHz
     float wavelengthSpacing = 50;
-    // beginWavelength is in nm: f or F is appended to treat it explicitly as simple float (and not double float)
-    final float beginWavelength = 1528.77f;
+    // BEGIN_WAVELENGTH is in nm: f or F is appended to treat it explicitly as simple float (and not double float)
+    static final float BEGIN_WAVELENGTH = 1528.77f;
     // java double is double float - d or D is appended to treat it explicitly as double float
-    final double precision = 10000d;
+    static final double PRECISION = 10000d;
 
     public FixedFlexImpl(Long index, double centreFrequency, double start, double stop, double wavelength) {
         this.index = index;
@@ -40,13 +40,13 @@ public final class FixedFlexImpl implements FixedFlexInterface {
     public FixedFlexImpl(long wlIndex) {
         this.centerFrequency = 196.1 - (wlIndex - 1) * wavelengthSpacing / 1000;
         // Truncate the value to the two decimal places
-        this.centerFrequency = Math.round(this.centerFrequency * precision) / precision;
+        this.centerFrequency = Math.round(this.centerFrequency * PRECISION) / PRECISION;
         this.start = this.centerFrequency - (wavelengthSpacing / 2) / 1000;
-        this.start = Math.round(this.start * precision) / precision;
+        this.start = Math.round(this.start * PRECISION) / PRECISION;
         this.stop = this.centerFrequency + (wavelengthSpacing / 2) / 1000;
-        this.stop = Math.round(this.stop * precision) / precision;
-        this.wavelength = beginWavelength + ((wlIndex - 1) * 0.40);
-        this.wavelength = Math.round(this.wavelength * precision) / precision;
+        this.stop = Math.round(this.stop * PRECISION) / PRECISION;
+        this.wavelength = BEGIN_WAVELENGTH + ((wlIndex - 1) * 0.40);
+        this.wavelength = Math.round(this.wavelength * PRECISION) / PRECISION;
     }
 
     @Override
@@ -59,13 +59,13 @@ public final class FixedFlexImpl implements FixedFlexInterface {
         long mappedWL = 61 - wlIndex;
         FixedFlexImpl fixedFlex = new FixedFlexImpl();
         fixedFlex.centerFrequency = 193.1 + (50.0 / 1000.0) * mappedWL;
-        fixedFlex.centerFrequency = Math.round(fixedFlex.centerFrequency * precision) / precision;
-        fixedFlex.wavelength = beginWavelength + ((wlIndex - 1) * 0.40);
-        fixedFlex.wavelength = Math.round(fixedFlex.wavelength * precision) / precision;
+        fixedFlex.centerFrequency = Math.round(fixedFlex.centerFrequency * PRECISION) / PRECISION;
+        fixedFlex.wavelength = BEGIN_WAVELENGTH + ((wlIndex - 1) * 0.40);
+        fixedFlex.wavelength = Math.round(fixedFlex.wavelength * PRECISION) / PRECISION;
         fixedFlex.start = 193.1 + (50.0 * mappedWL - 25) / 1000.0;
-        fixedFlex.start = Math.round(fixedFlex.start * precision) / precision;
+        fixedFlex.start = Math.round(fixedFlex.start * PRECISION) / PRECISION;
         fixedFlex.stop = 193.1 + (50.0 * mappedWL + 25) / 1000.0;
-        fixedFlex.stop = Math.round(fixedFlex.stop * precision) / precision;
+        fixedFlex.stop = Math.round(fixedFlex.stop * PRECISION) / PRECISION;
         fixedFlex.index = wlIndex;
         return fixedFlex;
     }
index 81e9d7c2fffd51aba0868519cf129b107fd4b254..2d3a1bb3904dd8bb2f156e02fd692419b0c45320 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.transportpce.common.mapping;
 
 import com.google.common.util.concurrent.FluentFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -483,7 +484,7 @@ public class PortMappingVersion121 {
                 degrees.add(ordmDegreeObject.get());
             }
         }
-        LOG.info("Device {} has {} degree", degrees.size());
+        LOG.info("Device {} has {} degree", deviceId, degrees.size());
         return degrees;
     }
 
@@ -608,7 +609,7 @@ public class PortMappingVersion121 {
             interfaceName = interfaceList.get(circuitPackName);
         }
         return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
-            .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
+            .setDegreeNumber(Long.valueOf(degreeNumber)).setInterfaceName(interfaceName).build();
     }
 
     private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
@@ -673,6 +674,7 @@ public class PortMappingVersion121 {
 
     // some LOG messages are too long
     @SuppressWarnings("checkstyle:linelength")
+    @SuppressFBWarnings("DM_CONVERT_CASE")
     private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
         // Creating mapping data for degree TTP's
         List<Degree> degrees = getDegrees(nodeId, deviceInfo);
@@ -752,7 +754,7 @@ public class PortMappingVersion121 {
                                 && Direction.Tx.getIntValue() == port2.getPortDirection().getIntValue()
                                 && port1.getPartnerPort() != null && port2.getPartnerPort() != null
                                 && port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
-                                && port1.getPartnerPort().getPortName().equals(port2.getPortName().toString())
+                                && port1.getPartnerPort().getPortName().equals(port2.getPortName())
                                 && port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
                                 && port2.getPartnerPort().getPortName().equals(port1.getPortName()))
                                 ||
@@ -762,9 +764,9 @@ public class PortMappingVersion121 {
                                 && Direction.Tx.getIntValue() == port1.getPortDirection().getIntValue()
                                 && port1.getPartnerPort() != null && port2.getPartnerPort() != null
                                 && port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
-                                && port1.getPartnerPort().getPortName().equals(port2.getPortName().toString())
+                                && port1.getPartnerPort().getPortName().equals(port2.getPortName())
                                 && port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
-                                && port2.getPartnerPort().getPortName().equals(port1.getPortName().toString()))) {
+                                && port2.getPartnerPort().getPortName().equals(port1.getPortName()))) {
                             String logicalConnectionPoint1 = new StringBuilder("DEG").append(k).append("-TTP-")
                                 .append(port1.getPortDirection().getName().toUpperCase()).toString();
                             LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId,
index 1cc524d23ba7772500d9a2e5ffb4cfc20501bc32..b867c390d3ae94b1714608501b8f23a4e2d309f2 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.transportpce.common.mapping;
 
 import com.google.common.util.concurrent.FluentFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -624,7 +625,7 @@ public class PortMappingVersion221 {
                 degrees.add(ordmDegreeObject.get());
             }
         }
-        LOG.info("Device {} has {} degree", degrees.size());
+        LOG.info("Device {} has {} degree", deviceId, degrees.size());
         return degrees;
     }
 
@@ -748,7 +749,7 @@ public class PortMappingVersion221 {
             interfaceName = interfaceList.get(circuitPackName);
         }
         return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
-            .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
+            .setDegreeNumber(Long.valueOf(degreeNumber)).setInterfaceName(interfaceName).build();
     }
 
     private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
@@ -819,6 +820,7 @@ public class PortMappingVersion221 {
 
     //some LOG messages are too long
     @SuppressWarnings("checkstyle:linelength")
+    @SuppressFBWarnings("DM_CONVERT_CASE")
     private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
         // Creating mapping data for degree TTP's
         List<Degree> degrees = getDegrees(nodeId, deviceInfo);
@@ -899,7 +901,7 @@ public class PortMappingVersion221 {
                                 && Direction.Tx.getIntValue() == port2.getPortDirection().getIntValue()
                                 && port1.getPartnerPort() != null && port2.getPartnerPort() != null
                                 && port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
-                                && port1.getPartnerPort().getPortName().equals(port2.getPortName().toString())
+                                && port1.getPartnerPort().getPortName().equals(port2.getPortName())
                                 && port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
                                 && port2.getPartnerPort().getPortName().equals(port1.getPortName()))
                                 ||
@@ -909,9 +911,9 @@ public class PortMappingVersion221 {
                                 && Direction.Tx.getIntValue() == port1.getPortDirection().getIntValue()
                                 && port1.getPartnerPort() != null && port2.getPartnerPort() != null
                                 && port1.getPartnerPort().getCircuitPackName().equals(cp2Name)
-                                && port1.getPartnerPort().getPortName().equals(port2.getPortName().toString())
+                                && port1.getPartnerPort().getPortName().equals(port2.getPortName())
                                 && port2.getPartnerPort().getCircuitPackName().equals(cp1Name)
-                                && port2.getPartnerPort().getPortName().equals(port1.getPortName().toString()))) {
+                                && port2.getPartnerPort().getPortName().equals(port1.getPortName()))) {
                             String logicalConnectionPoint1 = new StringBuilder("DEG").append(k).append("-TTP-")
                                 .append(port1.getPortDirection().getName().toUpperCase()).toString();
                             LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId,
index 539f95c3c30570c28e06f97a718ac020fdfb909d..7684df1e141f009e0ca4590dcac53e05fa4ce373 100644 (file)
@@ -67,7 +67,7 @@ public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
             LOG.info("getInterface for 2.2.1 device {}", nodeId);
             return (Optional<T>) openRoadmInterfacesImpl221.getInterface(nodeId,interfaceName);
         }
-        return null;
+        return Optional.empty();
     }
 
     @Override
index dab2a43224b11e31ed44d4bbae3159ea4ad950bc..3c8c95a1ab09429de9d2a80afc8ec82d8f106b7a 100755 (executable)
@@ -198,13 +198,13 @@ public class OpenRoadmInterfacesImpl221 {
         CircuitPacksBuilder cpBldr = new CircuitPacksBuilder(cp);
         boolean change = false;
         if (activate) {
-            if (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().getName()
-                .equals(States.NotReservedInuse)) {
+            if (cpBldr.getEquipmentState() != null
+                    && !cpBldr.getEquipmentState().getName().equals(States.NotReservedInuse)) {
                 cpBldr.setEquipmentState(States.NotReservedInuse);
                 change = true;
             }
-        } else if ((cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().getName()
-            .equals(States.NotReservedAvailable))) {
+        } else if ((cpBldr.getEquipmentState() != null
+                && !cpBldr.getEquipmentState().getName().equals(States.NotReservedAvailable))) {
             cpBldr.setEquipmentState(States.NotReservedAvailable);
             change = true;
         }
index 43100375db1f642b3970f9ae77210370afe921a7..88382548d6a355dc78b365f93015415a2e68c3ec 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.transportpce.networkmodel;
 
+//import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+//even with @SuppressFBwarnings generate a checkstyles error...
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -14,9 +16,7 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Collectors;
-
 import javax.annotation.Nonnull;
-
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
 import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
@@ -213,6 +213,7 @@ public class NetConfTopologyListener implements DataTreeChangeListener<Node> {
     }
 
     @Override
+    //@SuppressFBwarnings("SF_SWITCH_FALLTHROUGH")
     public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Node>> changes) {
         LOG.info("onDataTreeChanged");
         for (DataTreeModification<Node> change : changes) {
index 9df7962103b65a47a29bcba308d2f9877d8c6c2e..4826a145be9f7f128de6b88a49995ca2d3b937c8 100644 (file)
@@ -296,7 +296,7 @@ public class R2RLinkDiscovery {
         }
         return TopologyUtils.deleteLink(nodeId.getValue() + "-" + srcDegId.toString(),
                 destNodeId.getValue() + "-" + destDegId.toString(),
-                srcTpTx.toString(), destTpRx.toString(),networkTransactionService)
+                srcTpTx.toString(), destTpRx.toString(), networkTransactionService)
             && TopologyUtils.deleteLink(destNodeId.getValue() + "-" + destDegId.toString(),
                 nodeId.getValue() + "-" + srcDegId.toString(), destTpTx, srcTpRx,
                 networkTransactionService);
index 87b159bcaaab8fa7e798268720bf9f5ee30ac603..ee71be736193da9a90f5ca336a52d79c6f5a2e78 100644 (file)
@@ -67,7 +67,7 @@ public class AlarmNotificationListener implements OrgOpenroadmAlarmListener {
                 }
             }
         } catch (InterruptedException | ExecutionException ex) {
-            LOG.warn("Exception thrown while reading Logical Connection Point value from {} {}", ex);
+            LOG.warn("Exception thrown while reading Logical Connection Point value", ex);
         }
         StringBuilder sb = new StringBuilder(notification.getResource().getDevice().getNodeId()).append(PIPE);
         sb.append(buildCause(notification.getProbableCause()));
index 8f6f3ce2c79e34b74e57703e30da8a14bba36fbc..98cabb96e7bc018b0eda6e0e9e454669c869551b 100644 (file)
@@ -68,7 +68,7 @@ public class AlarmNotificationListener221 implements OrgOpenroadmAlarmListener {
                 }
             }
         } catch (InterruptedException | ExecutionException ex) {
-            LOG.warn("Exception thrown while reading Logical Connection Point value from {} {}", ex);
+            LOG.warn("Exception thrown while reading Logical Connection Point value", ex);
         }
         StringBuilder sb = new StringBuilder(notification.getResource().getDevice().getNodeId().getValue())
             .append(PIPE);
index 9702247bbb7a1a921c906f1532d40025ded8e05a..785a872d2f5d6664b2239b922c27142abf83574c 100644 (file)
@@ -314,7 +314,7 @@ public final class OpenRoadmOtnTopology {
         } else if (OpenroadmTpType.XPONDERNETWORK.equals(tpType)) {
             nbTps = node.getNbTpNetwork();
         } else {
-            LOG.warn("Wrong tp-type {}, cannot create tp {}", tpType.getName());
+            LOG.warn("Wrong tp-type {}, cannot create tp {}", tpType, tpType.getName());
         }
 
         for (int i = 1; i <= nbTps; i++) {
index 10910d76a31d8789d928fe11840dc0626c3545cb..05c15e13d21858b0e623f1fdbf05d599d33a2b76 100644 (file)
@@ -465,7 +465,7 @@ public final class OpenRoadmTopology {
         LOG.info("deleting link for {}-{}", srcNode, dstNode);
         LinkId linkId = LinkIdUtil.buildLinkId(srcNode, srcTp, dstNode, destTp);
         if (deleteLinkLinkId(linkId, networkTransactionService)) {
-            LOG.debug("Link Id {} updated to have admin state down");
+            LOG.debug("Link Id {} updated to have admin state down", linkId);
             return true;
         } else {
             LOG.debug("Link Id not found for Source {} and Dest {}", srcNode, dstNode);
index 179f641934d86577b763c1640fc957b2a6b69a73..2d001439488df24adabf04d6be286c91b43edf05 100644 (file)
@@ -72,7 +72,7 @@ public final class TopologyUtils {
         LOG.info("deleting link for {}-{}", srcNode, dstNode);
         LinkId linkId = LinkIdUtil.buildLinkId(srcNode, srcTp, dstNode, destTp);
         if (deleteLinkLinkId(linkId, networkTransactionService)) {
-            LOG.debug("Link Id {} updated to have admin state down");
+            LOG.debug("Link Id {} updated to have admin state down", linkId);
             return true;
         } else {
             LOG.debug("Link Id not found for Source {} and Dest {}", srcNode, dstNode);
index ba3b5b2ca850191c2a9ecdff7b4419b0e5d8ce70..e8fc629d9ca4c64d7ff5be36166da613d2bdb3a8 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.transportpce.olm.power;
 
+//import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.Map;
@@ -58,6 +59,7 @@ public class PowerMgmtImpl implements PowerMgmt {
      * @return true/false based on status of operation.
      */
     //TODO Need to Case Optical Power mode/NodeType in case of 2.2 devices
+    //@SuppressFBwarnings("DM_CONVERT_CASE")
     public Boolean setPower(ServicePowerSetupInput input) {
         LOG.info("Olm-setPower initiated");
         for (int i = 0; i < input.getNodes().size(); i++) {
@@ -261,7 +263,7 @@ public class PowerMgmtImpl implements PowerMgmt {
                                     OpticalControlMode.Power, powerValue, connectionNumber);
                             LOG.info("Success Value is {}", setXconnPowerSuccessVal);
                             if (setXconnPowerSuccessVal) {
-                                LOG.info("Roadm-connection: {} updated ");
+                                LOG.info("Roadm-connection: {} updated ", connectionNumber);
                                 //The value recommended by the white paper is 20 seconds and not 60.
                                 //TODO - commented code because one vendor is not supporting
                                 //GainLoss with target-output-power
@@ -274,7 +276,7 @@ public class PowerMgmtImpl implements PowerMgmt {
                                 return false;
                             }
                         } catch (InterruptedException e) {
-                            LOG.error("Olm-setPower wait failed {}", e);
+                            LOG.error("Olm-setPower wait failed :", e);
                             return false;
                         }
                     }
@@ -336,7 +338,7 @@ public class PowerMgmtImpl implements PowerMgmt {
                     }
                 } catch (InterruptedException e) {
                     // TODO Auto-generated catch block
-                    LOG.error("Olm-powerTurnDown wait failed {}",e);
+                    LOG.error("Olm-powerTurnDown wait failed",e);
                     return false;
                 }
             }
index 0cf590e43bf8e4ffc653de3ae49a806a7081348a..86de6863b0ce77cb3c37383f3a67e4c7f3994bd7 100644 (file)
@@ -188,7 +188,7 @@ public final class PowerMgmtVersion121 {
             LOG.info("Transponder Power update is committed");
             return true;
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Setting transponder power failed {}", e);
+            LOG.error("Setting transponder power failed", e);
             return false;
         }
 
index f7e530bb0061d200bb5a323e149a3bbff2d58eda..f202dbc82dec080d347b5f55a24c6e30c40cf083 100644 (file)
@@ -189,7 +189,7 @@ public final class PowerMgmtVersion221 {
             LOG.info("Transponder Power update is committed");
             return true;
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Setting transponder power failed {}", e);
+            LOG.error("Setting transponder power failed", e);
         }
         return false;
     }
index b306eee2a242357c42db7c8fbdf167c55f23d69a..15a37d94e0f7acd192e93b2a11b946f9b224b0dc 100644 (file)
@@ -490,7 +490,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
             }
         } catch (OpenRoadmInterfaceException e) {
             // TODO Auto-generated catch block
-            LOG.error("OpenRoadmInterfaceException occured {}",e);
+            LOG.error("OpenRoadmInterfaceException occured",e);
         } /**catch (InterruptedException e) {
          // TODO Auto-generated catch block
          } catch (ExecutionException e) {
@@ -517,9 +517,9 @@ public class OlmPowerServiceImpl implements OlmPowerService {
         LOG.info("Executing GetLinkSpanLoss");
         BigDecimal spanLoss = new BigDecimal(0);
         for (RoadmLinks link : roadmLinks) {
-            String sourceNodeId = link.getSrcNodeId().toString();
+            String sourceNodeId = link.getSrcNodeId();
             String sourceTpId = link.getSrcTpId();
-            String destNodeId = link.getDestNodeId().toString();
+            String destNodeId = link.getDestNodeId();
             String destTpId = link.getDestTpid();
             OtsPmHolder srcOtsPmHoler = getPmMeasurements(sourceNodeId, sourceTpId, "OpticalPowerOutput");
             OtsPmHolder destOtsPmHoler = getPmMeasurements(destNodeId, destTpId, "OpticalPowerInput");
@@ -550,7 +550,7 @@ public class OlmPowerServiceImpl implements OlmPowerService {
         try (ReadTransaction readOnlyTransaction = this.dataBroker.newReadOnlyTransaction()) {
             realNode = readOnlyTransaction.read(LogicalDatastoreType.CONFIGURATION, mappedNodeII).get();
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Error on getRealNodeId {} :", mappedNodeId, e);
             throw new IllegalStateException(e);
         }
         if (!realNode.isPresent() || (realNode.get().getSupportingNode() == null)) {
index 94b27b01e75e40b2c41ed19897d88f7fd04f6668..f8c2ecb6ad168aae131fc9bf7796371d33b6240b 100644 (file)
@@ -262,7 +262,7 @@ public class PceConstraintsCalc {
                         }
                         break;
                     default:
-                        LOG.info("in readDiversity unsupported divercity type", rt);
+                        LOG.info("in readDiversity unsupported divercity type {}", rt);
                 }
 
             } else {
@@ -289,7 +289,7 @@ public class PceConstraintsCalc {
             return true;
         }).map(aToZ -> {
             Node node = ((Node) aToZ.getResource().getResource());
-            return node.getNodeId().toString();
+            return node.getNodeId();
         }).collect(Collectors.toList());
     }
 
index 89adaec0186b670eabbbc3dd97ae4f6d6da97f7e..3c498da3d547a0e9351d2ac3f1ea1a78b688158b 100644 (file)
@@ -8,7 +8,7 @@
 
 package org.opendaylight.transportpce.pce.gnpy;
 
-import com.google.common.base.Preconditions;
+//import com.google.common.base.Preconditions;
 import com.google.gson.stream.JsonReader;
 
 import java.io.ByteArrayInputStream;
@@ -274,11 +274,11 @@ public class GnpyResult {
     public <T extends DataObject> Optional<T> getDataObject(@Nonnull NormalizedNode<?, ?> normalizedNode,
         @Nonnull QName rootNode, BindingNormalizedNodeSerializer codecRegistry) {
         if (normalizedNode != null) {
-            LOG.debug("GNPy: The codecRegistry is ", codecRegistry.toString());
+            LOG.debug("GNPy: The codecRegistry is {}", codecRegistry.toString());
         } else {
             LOG.warn("GNPy: The codecRegistry is null");
         }
-        Preconditions.checkNotNull(normalizedNode);
+        //Preconditions.checkNotNull(normalizedNode);
         if (normalizedNode instanceof ContainerNode) {
             YangInstanceIdentifier.PathArgument directChildIdentifier = YangInstanceIdentifier.of(rootNode)
                 .getLastPathArgument();
@@ -288,10 +288,10 @@ public class GnpyResult {
                 throw new IllegalStateException(String.format("Could not get the direct child of %s", rootNode));
             }
             normalizedNode = directChild.get();
-            LOG.debug("GNPy: the normalized node is ", normalizedNode.getNodeType());
+            LOG.debug("GNPy: the normalized node is {}", normalizedNode.getNodeType());
         }
         YangInstanceIdentifier rootNodeYangInstanceIdentifier = YangInstanceIdentifier.of(rootNode);
-        LOG.debug("GNPy: the root Node Yang Instance Identifier is ", rootNodeYangInstanceIdentifier.toString());
+        LOG.debug("GNPy: the root Node Yang Instance Identifier is {}", rootNodeYangInstanceIdentifier.toString());
         Map.Entry<?, ?> bindingNodeEntry = codecRegistry.fromNormalizedNode(rootNodeYangInstanceIdentifier,
             normalizedNode);
         if (bindingNodeEntry == null) {
index 060895b34418f12a6fb7fe66c62069d53e887f90..d32ab4214d5178f7abb3722fcb5d728e80a0ba00 100644 (file)
@@ -261,7 +261,7 @@ public class GnpyServiceImpl {
         }
 
         for (Elements element : this.elements) {
-            if (element.getUid().contains(ipAddress.getIpv4Address().getValue().toString())) {
+            if (element.getUid().contains(ipAddress.getIpv4Address().getValue())) {
                 if ((this.currentNodeIpAddress == null) || (this.currentNodeIpAddress != ipAddress)) {
                     this.currentNodeIpAddress = ipAddress;
                     RouteObjectIncludeExclude routeObjectIncludeExclude = addRouteObjectIncludeExclude(ipAddress, 1);
@@ -280,7 +280,7 @@ public class GnpyServiceImpl {
     //Add a link to the route object
     private void addLinkToRouteObject(String linkId) throws GnpyException {
         if (linkId == null) {
-            throw new GnpyException(String.format("In GnpyServiceImpl: the linkId %s does not exist",linkId));
+            throw new GnpyException(String.format("In GnpyServiceImpl: the linkId does not exist"));
         }
         //Only the ROADM-to-ROADM link are included in the route object
         if (!mapLinkFiber.containsKey(linkId)) {
@@ -308,7 +308,7 @@ public class GnpyServiceImpl {
         TeTpId teTpId = new TeTpId(teTpValue);
         NumUnnumHop numUnnumHop = new org.opendaylight.yang.gen.v1.gnpy.path.rev190502.explicit.route.hop.type.num
             .unnum.hop.NumUnnumHopBuilder()
-                .setNodeId(teNodeId.getIpv4Address().getValue().toString())
+                .setNodeId(teNodeId.getIpv4Address().getValue())
                 .setLinkTpId(teTpId.getUint32().toString())
                 .setHopType(TeHopType.STRICT).build();
         Type type1 = new NumUnnumHopBuilder().setNumUnnumHop(numUnnumHop).build();
@@ -348,8 +348,8 @@ public class GnpyServiceImpl {
             .setDisjointness(new TePathDisjointness(true, true, false))
             .setRequestIdNumber(requestIdNumber).build();
         List<Synchronization> synchro = new ArrayList<>();
-        Synchronization synchronization1 = new SynchronizationBuilder().setSynchronizationId(new Long(0)).setSvec(svec)
-            .build();
+        Synchronization synchronization1 = new SynchronizationBuilder().setSynchronizationId(Long.valueOf(0))
+                .setSvec(svec).build();
         synchro.add(synchronization1);
         return (synchro);
     }
index f0f55dca73a8f10c8df7d6fc698114f9e9062a38..5560ea7ddcecb8a5bfad708dd39f1121d519c25a 100644 (file)
@@ -190,15 +190,14 @@ public class GnpyTopoImpl {
                 if (commonNetworkNode1.getNodeType().getName().equals("ROADM")) {
                     if (!nodesList.contains(nodeRef)) {
                         Elements element = createElementsRoadm(LATITUDE, LONGITUTE, nodeRef,
-                                openRoadmNetNode1.getShelf(),TARGET_PCH_OUT_DB, ipAddress.getIpv4Address().getValue()
-                                .toString());
+                                openRoadmNetNode1.getShelf(),TARGET_PCH_OUT_DB, ipAddress.getIpv4Address().getValue());
                         this.elements.add(element);
                         nodesList.add(nodeRef);
                     }
                 } else if (commonNetworkNode1.getNodeType().getName().equals("XPONDER")) {
                     if (!nodesList.contains(nodeRef)) {
                         Elements element = createElementsTransceiver(LATITUDE, LONGITUTE, nodeRef,
-                                openRoadmNetNode1.getShelf(),ipAddress.getIpv4Address().getValue().toString());
+                                openRoadmNetNode1.getShelf(),ipAddress.getIpv4Address().getValue());
                         this.elements.add(element);
                         nodesList.add(nodeRef);
                         trxList.add(nodeRef);
@@ -309,7 +308,7 @@ public class GnpyTopoImpl {
         Elements element = createElementsEdfa(LATITUDE, LONGITUTE, REGION, CITY,
                 ila.getGain().getValue(), ila.getTilt().getValue(),
                 ila.getOutVoaAtt().getValue(), "std_medium_gain",
-                ipEdfa.getIpv4Address().getValue().toString());
+                ipEdfa.getIpv4Address().getValue());
         this.elements.add(element);
         return ipEdfa;
     }
index 5342387afa0008c5539f2b8e0b6669a168a2a45b..b282b7d37b45cf25404b6d24fdd1c9934735d15f 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.transportpce.pce.gnpy;
 
 import com.google.common.base.Function;
+//false positive in SpotBug -> cannot be used with FluentIterable...
 import com.google.common.collect.FluentIterable;
 
 import java.io.BufferedWriter;
index f0a8e67a4291553501aa405a2aed34b81b552718..c6158756f0e9a91b0928ce180df000539d05a4a7 100644 (file)
@@ -471,6 +471,7 @@ public class PceCalculation {
         Node1 node1 = node.augmentation(Node1.class);
         if (node1 == null) {
             LOG.error("getNodeType: no Node1 (type) Augmentation for node: [{}]. Node is ignored", node.getNodeId());
+            return false;
         }
         OpenroadmNodeType nodeType = node1.getNodeType();
 
index 0a2159484e271882bfef084c2be86b14381ff4bb..92b483d65da9fc8b81dd9d3e9bf07435f09eec9c 100644 (file)
@@ -129,7 +129,7 @@ public class PceLink {
             for (int i = 0; i < this.omsAttributesSpan.getLinkConcatenation().size(); i++) {
                 //Length is expressed in meter and latency is expressed in ms according to OpenROADM MSA
                 tmp += this.omsAttributesSpan.getLinkConcatenation().get(i).getSRLGLength() / CELERITY;
-                LOG.info("In PceLink: The latency of link {} == {}",link.getLinkId(),tmplatency);
+                LOG.info("In PceLink: The latency of link {} == {}",link.getLinkId(),tmp);
             }
             tmplatency = (long) Math.ceil(tmp);
         } catch (NullPointerException e) {
index e8b70cc3eaebe64e587cc8ee42ac8fdc06f1017f..e9273e1d279f5f92d482bbb2ccace2152f163722 100644 (file)
@@ -111,7 +111,7 @@ public class PceOpticalNode implements PceNode {
                         LOG.info("initSrgTpList: adding SRG-PP tp '{}'", tp.getTpId().getValue());
                         this.availableSrgPp.put(tp.getTpId().getValue(), cntp1.getTpType());
                     } else {
-                        LOG.warn("initSrgTpList: SRG-PP tp = {} found is busy !!");
+                        LOG.warn("initSrgTpList: SRG-PP tp = {} found is busy !!", tp.getTpId().getValue());
                     }
                     break;
                 default:
@@ -245,7 +245,7 @@ public class PceOpticalNode implements PceNode {
         OpenroadmTpType srgType = null;
         OpenroadmTpType cpType = this.availableSrgCp.get(tp);
         if (cpType == null) {
-            LOG.error("getRdmSrgClient: tp {} not existed in SRG CPterminationPoint list");
+            LOG.error("getRdmSrgClient: tp {} not existed in SRG CPterminationPoint list", tp);
             return null;
         }
         switch (cpType) {
index 1b4e0589d148ea8a01fbe1e82b83c4ec4d3535ee..ae7c81bf3fb887b681b554e4ff612483c40a5e17 100644 (file)
@@ -88,7 +88,7 @@ public class PathComputationServiceImpl implements PathComputationService {
         try {
             notificationPublishService.putNotification(this.notification);
         } catch (InterruptedException e) {
-            LOG.info("notification offer rejected : ", e.getMessage());
+            LOG.info("notification offer rejected: ", e);
         }
     }
 
index 61c3113b750a8aff24086c0d15816ff1434fea16..c01d7960903fafcd51a60856380e36da1fd531e2 100644 (file)
@@ -90,7 +90,7 @@ public final class ModelMappingUtils {
         ServicePathInputBuilder servicePathInputBuilder = new ServicePathInputBuilder()
             .setServiceName(serviceName)
             .setOperation(ServicePathInput.Operation.Create)
-            .setWaveNumber(new Long(pathDescription.getAToZDirection().getAToZWavelengthNumber()))
+            .setWaveNumber(Long.valueOf(pathDescription.getAToZDirection().getAToZWavelengthNumber()))
             .setNodes(nodeLists.getList());
         return new ServicePathInputData(servicePathInputBuilder.build(), nodeLists);
     }
@@ -101,7 +101,7 @@ public final class ModelMappingUtils {
         ServicePathInputBuilder servicePathInputBuilder = new ServicePathInputBuilder()
             .setOperation(ServicePathInput.Operation.Create)
             .setServiceName(serviceName)
-            .setWaveNumber(new Long(pathDescription.getZToADirection().getZToAWavelengthNumber()))
+            .setWaveNumber(Long.valueOf(pathDescription.getZToADirection().getZToAWavelengthNumber()))
             .setNodes(nodeLists.getList());
         return new ServicePathInputData(servicePathInputBuilder.build(), nodeLists);
     }
index 2bd6d995fcbb3bb0ad57d0814b764135301b92e2..bee4d90eb2697d7d85af7a956d26d8b72a17bcad 100644 (file)
@@ -104,14 +104,14 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
         try {
             notificationPublishService.putNotification(this.notification);
         } catch (InterruptedException e) {
-            LOG.info("notification offer rejected : ", e.getMessage());
+            LOG.info("notification offer rejected: ", e);
         }
     }
 
     @Override
     public ListenableFuture<ServiceImplementationRequestOutput>
             serviceImplementation(ServiceImplementationRequestInput input) {
-        LOG.info("Calling service impl request {} {}", input.getServiceName());
+        LOG.info("Calling service impl request {}", input.getServiceName());
         return executor.submit(new Callable<ServiceImplementationRequestOutput>() {
 
             @Override
@@ -202,7 +202,7 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
     @Override
     public ListenableFuture<ServiceDeleteOutput> serviceDelete(ServiceDeleteInput input) {
         String serviceName = input.getServiceName();
-        LOG.info("Calling service delete request {} {}", input.getServiceName());
+        LOG.info("Calling service delete request {}", input.getServiceName());
         return executor.submit(new Callable<ServiceDeleteOutput>() {
 
             @Override
index 165dc88106e0ebec63171b989f26a86ced1cb280..58f3d1f4de427e8ccc86aadf3a4f28e5cf6a0386 100644 (file)
@@ -52,7 +52,7 @@ public class OlmPowerSetupRollbackTask extends RollbackTask {
         if (FAILED.equals(powerTurndownResult.getResult().getResult())) {
             LOG.warn("Olmp power setup rollback for {} was not successful!", this.getId());
         } else {
-            LOG.info("Olm power setup rollback for {} was successful.");
+            LOG.info("Olm power setup rollback for {} was successful.", this.getId());
         }
         return null;
     }
index dce7d7178e6a1c248456a4dcf8aa7c56962efd20..aa36fc506170e2c6201b7427608c70862cba6525 100644 (file)
@@ -35,7 +35,7 @@ public class TransportPCEServicePathRPCImpl implements TransportpceRendererServi
     @Override
     public ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDelete(ServiceDeleteInput input) {
         String serviceName = input.getServiceName();
-        LOG.info("Calling RPC service delete request {} {}", serviceName);
+        LOG.info("Calling RPC service delete request {}", serviceName);
         ServiceDeleteOutput output = null;
         try {
             output = this.rendererServiceOperations.serviceDelete(input).get();
@@ -49,7 +49,7 @@ public class TransportPCEServicePathRPCImpl implements TransportpceRendererServi
     public ListenableFuture<RpcResult<ServiceImplementationRequestOutput>> serviceImplementationRequest(
             ServiceImplementationRequestInput input) {
         String serviceName = input.getServiceName();
-        LOG.info("Calling RPC service impl request {} {}", serviceName);
+        LOG.info("Calling RPC service impl request {}", serviceName);
         ServiceImplementationRequestOutput output = null;
         try {
             output = this.rendererServiceOperations.serviceImplementation(input).get();
index 4ca93795b194bd782e6665df19c8764440d19c46..be863a49e85a92c2536b03c811ca406d0bd0c51b 100644 (file)
@@ -57,7 +57,7 @@ public class StubPceServiceOperations implements PathComputationService {
             LOG.info("putting notification : {}", notif);
             notificationPublishService.putNotification(notif);
         } catch (InterruptedException e) {
-            LOG.info("notification offer rejected : ", e.getMessage());
+            LOG.info("notification offer rejected: ", e);
         }
     }
 
index 38c1d4c1e63669c6e88a9f815b8a7d1535e87155..a3a0ca07592de8db6b119a717c1f9243c4beeb5e 100644 (file)
@@ -71,7 +71,7 @@ public class StubRendererServiceOperations implements RendererServiceOperations
             LOG.info("putting notification : {}", notif);
             notificationPublishService.putNotification(notif);
         } catch (InterruptedException e) {
-            LOG.info("notification offer rejected : ", e.getMessage());
+            LOG.info("notification offer rejected: ", e);
         }
     }
 
index 4256b8e255a5378cea0511d25a22539416b03e14..501b5c4a1b4e54332f1aea0a00210f01eaf10397 100644 (file)
@@ -54,7 +54,7 @@ public final class TapiUtils {
         String txPortName, String rxPortDeviceName, String rxPortName) {
         ServiceAEnd serviceAEnd = new ServiceAEndBuilder().setClli(clli).setNodeId(new NodeIdType(nodeid)).setOpticType(
             OpticTypes.Gray).setServiceFormat(
-                ServiceFormat.Ethernet).setServiceRate(new Long(100))
+                ServiceFormat.Ethernet).setServiceRate(Long.valueOf(100))
             .setTxDirection(
                 new TxDirectionBuilder()
                     .setPort(new PortBuilder().setPortDeviceName(txPortDeviceName).setPortName(txPortName)
@@ -76,7 +76,7 @@ public final class TapiUtils {
         String txPortName, String rxPortDeviceName, String rxPortName) {
         ServiceZEnd serviceZEnd = new ServiceZEndBuilder().setClli(clli).setNodeId(new NodeIdType(nodeid)).setOpticType(
             OpticTypes.Gray).setServiceFormat(
-                ServiceFormat.Ethernet).setServiceRate(new Long(100))
+                ServiceFormat.Ethernet).setServiceRate(Long.valueOf(100))
             .setTxDirection(
                 new TxDirectionBuilder()
                     .setPort(new PortBuilder().setPortDeviceName(txPortDeviceName).setPortName(txPortName)
index aba87de6e513014eb31d755d8f2dca72f4773de5..ec3bce4a9cec0dd73f85f504583cb88af8337edb 100644 (file)
@@ -75,7 +75,7 @@ public final class CreateConnectivityServiceValidation {
 
         } catch (NullPointerException e) {
             LOG.error("one of input parameter is null ", e);
-            OperationResult.failed("one of input parameter is null.");
+            return OperationResult.failed("one of input parameter is null.");
         }
         return OperationResult.ok("Validation successful.");
     }