Fix findbugs warnings 33/75333/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 20 Aug 2018 15:29:30 +0000 (17:29 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 20 Aug 2018 22:18:04 +0000 (00:18 +0200)
These bugs are reported by upgraded findbugs, fix them prior
to the actual upgrade.

Change-Id: I0c21059a289abec1631f3a7b324c771091930804
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/add/OffsetMap.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/base/OffsetMap.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CodecsRegistryImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/StrictBGPPeerRegistry.java
bgp/rib-mock/src/main/java/org/opendaylight/protocol/bgp/rib/mock/BGPMock.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/util/ClusterSingletonServiceRegistrationHelper.java

index 5f6de622dcba0434b0ddcf8204a979ac3aa28a61..e42328069ee8d938f51b4f265eee77149bbc3c4c 100644 (file)
@@ -78,7 +78,7 @@ public final class OffsetMap {
         final Builder<RouteKey> builder = ImmutableSet.builder();
         final int index = indexOfRouterId(key);
         if (index < 0) {
-            LOG.trace("Router key not found", key);
+            LOG.trace("Router key {} not found", key);
         } else {
             builder.add(removeValue(this.routeKeys, index, EMPTY_KEYS));
         }
index d07ccf3b51f05000ce02db4a79eea3528a02744a..fad05e78e825d35a36cc3149f95f69650b33ba81 100644 (file)
@@ -81,7 +81,7 @@ final class OffsetMap {
         final Builder<UnsignedInteger> builder = ImmutableSet.builder();
         final int index = indexOfRouterId(key);
         if (index < 0) {
-            LOG.trace("Router key not found", key);
+            LOG.trace("Router key {} not found", key);
         } else {
             builder.add(removeValue(this.routeKeys, index, EMPTY_KEYS));
         }
index b3c1665a5ec6dc27ba02af2a301f0657af4d397c..540e5eacee9dd3acbc6948b79841d7ef2a45c840 100644 (file)
@@ -66,7 +66,7 @@ public final class CodecsRegistryImpl implements CodecsRegistry {
             try {
                 codecs.onCodecTreeUpdated(this.latestCodecTree);
             } catch (final Exception e) {
-                LOG.error("Codec creation threw {}", e.getMessage(), e);
+                LOG.error("Codec creation threw {}", e);
             }
         }
     }
index eee78d287c8adef8eaa3cc285bbfd8d5ce7b9e98..437136e8c00bae0df4925fb7ae9a26c760369daf 100644 (file)
@@ -300,7 +300,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
                 = this.effRibTables.child(Tables.class, tableKey);
 
         // Create an empty table
-        LOG.trace("Create Empty table", tablePath);
+        LOG.trace("Create Empty table at {}", tablePath);
         if (table.getDataBefore() == null) {
             tx.put(LogicalDatastoreType.OPERATIONAL, tablePath, new TablesBuilder()
                     .setAfi(tableKey.getAfi()).setSafi(tableKey.getSafi())
index 477cd616847f7c2905894b2fa761627905e63195..0fa2fa7f14a1a6846a1cfb8b64c0bfad79ae2539 100644 (file)
@@ -179,7 +179,7 @@ public final class StrictBGPPeerRegistry implements BGPPeerRegistry {
                 return this.peers.get(ip);
                 // Session reestablished with same source bgp id, dropping current as duplicate
             } else {
-                LOG.warn("BGP session with %s initiated from %s to %s has to be dropped. Same session already present",
+                LOG.warn("BGP session with {} initiated from {} to {} has to be dropped. Same session already present",
                         ip, sourceId, remoteId);
                 throw new BGPDocumentedException(
                         String.format("BGP session with %s initiated %s has to be dropped. "
index 303f154c48ddc9ac9c901add541ebacb3927a8b9..61f82893b516b2c1d6f316d04f90265ace7aa1ca 100644 (file)
@@ -61,7 +61,7 @@ public final class BGPMock implements Closeable {
                 messages.add(registry.parseMessage(Unpooled.copiedBuffer(body), null));
             }
         } catch (final BGPDocumentedException | BGPParsingException e) {
-            LOG.warn("Failed to parse message {}", e.getMessage(), e);
+            LOG.warn("Failed to parse message", e);
         }
         return messages;
     }
index 9c3174ecefc02a5346386c54e8e1a28767fe0097..19f9b20e9644fa2599d096b0339ed7def3aca1f9 100644 (file)
@@ -56,7 +56,7 @@ public final class ClusterSingletonServiceRegistrationHelper {
                     throw e;
                 }
                 attempts--;
-                LOG.warn("Failed to register {} service to ClusterSingletonServiceProvider. Try again in {} ms. {}",
+                LOG.warn("Failed to register {} service to ClusterSingletonServiceProvider. Try again in {} ms.",
                     clusterSingletonService, sleepTime, e);
                 Uninterruptibles.sleepUninterruptibly(sleepTime, TimeUnit.MILLISECONDS);
             }