Do not use toString() in looging messages 36/85536/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 28 Oct 2019 12:45:05 +0000 (13:45 +0100)
committerRobert Varga <nite@hq.sk>
Mon, 4 Nov 2019 13:36:45 +0000 (13:36 +0000)
This eliminates unnecessary toString() calls, as logging implementation
will call it when necessary.

Change-Id: Ic3b45b9ae34c29951ed6eea94cae39c423b6ec26
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9be412d7d6acf298a740e8325f1382422e32afa1)

netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSession.java
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSession.java
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/NetconfConfigurationImpl.java

index bb0964bb5892541877af2a4eaeec518b53d8647d..a08f52d1caccb7c3acc3d65b3e41e7f7321a9eaf 100644 (file)
@@ -69,7 +69,7 @@ public final class NetconfServerSession extends AbstractNetconfSession<NetconfSe
         super(sessionListener, channel, sessionId);
         this.header = header;
         this.sessionListener = sessionListener;
-        LOG.debug("Session {} created", toString());
+        LOG.debug("Session {} created", this);
     }
 
     @Override
index 045b6d6d3e3d5b881ffa430530668a1d187ceb25..aab5b6d0c0320ae2e686db53bb3edd7455ceb090 100644 (file)
@@ -88,7 +88,7 @@ public abstract class AbstractNetconfSession<S extends NetconfSession,L extends
     }
 
     protected void endOfInput() {
-        LOG.debug("Session {} end of input detected while session was in state {}", toString(), isUp() ? "up"
+        LOG.debug("Session {} end of input detected while session was in state {}", this, isUp() ? "up"
                 : "initialized");
         if (isUp()) {
             this.sessionListener.onSessionDown(thisInstance(),
@@ -97,7 +97,7 @@ public abstract class AbstractNetconfSession<S extends NetconfSession,L extends
     }
 
     protected void sessionUp() {
-        LOG.debug("Session {} up", toString());
+        LOG.debug("Session {} up", this);
         sessionListener.onSessionUp(thisInstance());
         this.up = true;
     }
index 42c7b58871681786f58aece834783342ffad4ab9..d541979ec68cb007d2f010586ef96af520cec785 100644 (file)
@@ -63,7 +63,7 @@ public class NetconfConfigurationImpl implements NetconfConfiguration, ManagedSe
                 sshServerAddress,
                 (String) dictionaryConfig.get(SSH_PK_PATH_PROP));
 
-        LOG.debug("CSS netconf server configuration was updated: {}", dictionaryConfig.toString());
+        LOG.debug("CSS netconf server configuration was updated: {}", dictionaryConfig);
     }
 
     @Override
@@ -80,4 +80,4 @@ public class NetconfConfigurationImpl implements NetconfConfiguration, ManagedSe
     public String getPrivateKeyPath() {
         return netconfConfiguration.getPrivateKeyPath();
     }
-}
\ No newline at end of file
+}