enable SpotBugs 30/77930/5
authorMichael Vorburger <vorburger@redhat.com>
Mon, 19 Nov 2018 09:44:59 +0000 (10:44 +0100)
committerMichael Vorburger <vorburger@redhat.com>
Thu, 22 Nov 2018 13:38:11 +0000 (13:38 +0000)
incl. fixing wrong logger in NeutronObject and missing placeholders in
logs of NeutronHostconfigOvsListener and NeutronHostconfigVppListener.

Change-Id: If61b3cdfd59f92689937e219490f813e73084c3e
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
neutron-hostconfig/ovs/src/main/java/org/opendaylight/neutron/hostconfig/ovs/NeutronHostconfigOvsListener.java
neutron-hostconfig/vpp/src/main/java/org/opendaylight/neutron/hostconfig/vpp/NeutronHostconfigVppListener.java
neutron-logger/src/main/java/org/opendaylight/neutron/logger/NeutronLogger.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronObject.java
parent/pom.xml

index d5e2d43a046ff8236bb042036956f1135c0be70c..8534621f5d226678d8e82b5f99708d2c58a8c741 100644 (file)
@@ -63,7 +63,7 @@ public class NeutronHostconfigOvsListener implements ClusteredDataTreeChangeList
 
     private void processChanges(Collection<DataTreeModification<Node>> changes)
             throws TransactionCommitFailedException {
-        LOG.info("onDataTreeChanged: Received Data Tree Changed ...", changes);
+        LOG.info("onDataTreeChanged: Received Data Tree Changes: {}", changes);
         for (DataTreeModification<Node> change : changes) {
             final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
             final DataObjectModification<Node> mod = change.getRootNode();
@@ -93,7 +93,7 @@ public class NeutronHostconfigOvsListener implements ClusteredDataTreeChangeList
         try {
             processChanges(changes);
         } catch (TransactionCommitFailedException e) {
-            LOG.error("Transaction commit failed; ignorining changes: ", changes, e);
+            LOG.error("Transaction commit failed; ignorining changes: {}", changes, e);
         }
     }
 
index 64d791618fdd80029d7dbae670a553cc0b34935e..2e17d3e8b64b74b363a8fb2c4186811b1beab716 100644 (file)
@@ -80,7 +80,7 @@ public class NeutronHostconfigVppListener implements ClusteredDataTreeChangeList
 
     @Override
     public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Node>> changes) {
-        LOG.info("onDataTreeChanged: Received Data Tree Changed ...", changes);
+        LOG.info("onDataTreeChanged: Received Data Tree Changes: {}", changes);
         executorService.execute(() -> {
             try {
                 for (DataTreeModification<Node> change : Preconditions.checkNotNull(changes,
@@ -88,7 +88,7 @@ public class NeutronHostconfigVppListener implements ClusteredDataTreeChangeList
                     processDataTreeModification(change);
                 }
             } catch (TransactionCommitFailedException e) {
-                LOG.error("Transaction commit failed; ignorining changes: ", changes, e);
+                LOG.error("Transaction commit failed; ignorining changes: {}", changes, e);
             }
         });
     }
index bbc2ef2dc1cf272cbee85dde23ffb19f1dc859a9..355278d847ed0a498827e472ab55f7f3ebac54a2 100644 (file)
@@ -93,7 +93,7 @@ public final class NeutronLogger {
         if (LOG.isInfoEnabled()) {
             final StringBuilder messageBuilder = new StringBuilder(prefix);
             formatChanges(messageBuilder, changes);
-            LOG.info("{}", messageBuilder.toString());
+            LOG.info("Changes: {}", messageBuilder.toString());
         }
     }
 
index c547954659af52ea660faff975821d5727b3d560..d2fc06cc2038fb7513e88b18abe89ae1250cbe25 100644 (file)
@@ -28,7 +28,7 @@ public abstract class NeutronObject<T extends NeutronObject<T>> extends NeutronI
     // T extends NeutronObject as 0th type argument. Used by extractFields()
     private static final int NEUTRON_OBJECT_CLASS_TYPE_INDEX = 0;
 
-    private static final Logger LOG = LoggerFactory.getLogger(NeutronFirewallRule.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NeutronObject.class);
 
     private static final long serialVersionUID = 1L;
 
index fd21e493482b19da25b8f8ef0f4612da1310fbeb..70f775bc2f7eb2f0acceeed10551ca1edfd0542a 100644 (file)
           <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>com.github.spotbugs</groupId>
+        <artifactId>spotbugs-maven-plugin</artifactId>
+        <configuration>
+          <failOnError>true</failOnError>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>