From fffb9f3d3bd7010d0c35ce75bdf8c58094a55256 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 22 Mar 2019 20:32:08 +0100 Subject: [PATCH] Fix logging arguments Upgraded spotbugs is finding these violations, fix them up. Change-Id: I6f7490cd1d48c6e22d048842265bf71d0ff24afc Signed-off-by: Robert Varga --- .../md/sal/binding/impl/ContextReferenceExtractor.java | 7 ++++--- .../controller/md/sal/common/util/jmx/AbstractMXBean.java | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ContextReferenceExtractor.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ContextReferenceExtractor.java index 043501c768..e3127eddb5 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ContextReferenceExtractor.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/ContextReferenceExtractor.java @@ -66,14 +66,15 @@ abstract class ContextReferenceExtractor { if (InstanceIdentifier.class.isAssignableFrom(returnType)) { return DirectGetterRouteContextExtractor.create(contextGetter); } - final Method getValueMethod = findGetValueMethod(returnType,InstanceIdentifier.class); + final Method getValueMethod = findGetValueMethod(returnType, InstanceIdentifier.class); if (getValueMethod != null) { return GetValueRouteContextExtractor.create(contextGetter, getValueMethod); } else { - LOG.warn("Class {} can not be used to determine context, falling back to NULL_EXTRACTOR.",returnType); + LOG.warn("Class {} can not be used to determine context, falling back to NULL_EXTRACTOR.", returnType); } } catch (final IllegalAccessException e) { - LOG.warn("Class {} does not conform to Binding Specification v1. Falling back to NULL_EXTRACTOR", e); + LOG.warn("Class {} does not conform to Binding Specification v1. Falling back to NULL_EXTRACTOR", + returnType, e); } return NULL_EXTRACTOR; } diff --git a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/md/sal/common/util/jmx/AbstractMXBean.java b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/md/sal/common/util/jmx/AbstractMXBean.java index 0ce05ebd1e..223132c95b 100644 --- a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/md/sal/common/util/jmx/AbstractMXBean.java +++ b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/md/sal/common/util/jmx/AbstractMXBean.java @@ -110,7 +110,7 @@ public abstract class AbstractMXBean { LOG.debug("MBean {} registered successfully", mbeanName.getCanonicalName()); } catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException | MalformedObjectNameException e) { - LOG.error("registration failed {}", e); + LOG.error("registration failed", e); } return registered; } @@ -135,7 +135,7 @@ public abstract class AbstractMXBean { unregisterMBean(mbeanName); unregister = true; } catch (MBeanRegistrationException | InstanceNotFoundException | MalformedObjectNameException e) { - LOG.debug("Failed when unregistering MBean {}", e); + LOG.debug("Failed when unregistering MBean", e); } return unregister; -- 2.36.6