You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pa...@apache.org on 2018/09/11 17:39:46 UTC

[camel] 02/02: Remove #toString calls on arguments of parameterized log messages.

This is an automated email from the ASF dual-hosted git repository.

pascalschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 59780e61a34970e37bf8e205e1759e5ca06e42a1
Author: Pascal Schumacher <pa...@gmx.net>
AuthorDate: Tue Sep 11 19:39:31 2018 +0200

    Remove #toString calls on arguments of parameterized log messages.
---
 .../apache/camel/impl/DefaultAsyncProcessorAwaitManager.java   |  4 ++--
 .../java/org/apache/camel/component/atmos/AtmosEndpoint.java   |  4 ++--
 .../org/apache/camel/component/dropbox/DropboxEndpoint.java    |  4 ++--
 .../apache/camel/component/kubernetes/KubernetesHelper.java    |  2 +-
 .../java/org/apache/camel/component/ldif/LdifProducer.java     | 10 +++++-----
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultAsyncProcessorAwaitManager.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultAsyncProcessorAwaitManager.java
index 91d492f..f0891a5 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultAsyncProcessorAwaitManager.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultAsyncProcessorAwaitManager.java
@@ -197,7 +197,7 @@ public class DefaultAsyncProcessorAwaitManager extends ServiceSupport implements
             }
 
             if (isInterruptThreadsWhileStopping()) {
-                LOG.warn("The following threads are blocked and will be interrupted so the threads are released:\n{}", sb.toString());
+                LOG.warn("The following threads are blocked and will be interrupted so the threads are released:\n{}", sb);
                 for (AwaitThread entry : threads) {
                     try {
                         interrupt(entry.getExchange());
@@ -206,7 +206,7 @@ public class DefaultAsyncProcessorAwaitManager extends ServiceSupport implements
                     }
                 }
             } else {
-                LOG.warn("The following threads are blocked, and may reside in the JVM:\n{}", sb.toString());
+                LOG.warn("The following threads are blocked, and may reside in the JVM:\n{}", sb);
             }
         } else {
             LOG.debug("Shutting down with no inflight threads.");
diff --git a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java
index 2779e0b..8261c44 100644
--- a/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java
+++ b/components/camel-atmos/src/main/java/org/apache/camel/component/atmos/AtmosEndpoint.java
@@ -73,7 +73,7 @@ public class AtmosEndpoint extends DefaultEndpoint {
      * @throws Exception
      */
     public Producer createProducer() throws Exception {
-        LOG.debug("resolve producer atmos endpoint {{}}", configuration.getOperation().toString());
+        LOG.debug("resolve producer atmos endpoint {{}}", configuration.getOperation());
         LOG.debug("resolve producer atmos attached client: {}", configuration.getClient());
         if (configuration.getOperation() == AtmosOperation.put) {
             return new AtmosPutProducer(this, configuration);
@@ -96,7 +96,7 @@ public class AtmosEndpoint extends DefaultEndpoint {
      * @throws Exception
      */
     public Consumer createConsumer(Processor processor) throws Exception {
-        LOG.debug("resolve consumer atmos endpoint {{}}", configuration.getOperation().toString());
+        LOG.debug("resolve consumer atmos endpoint {{}}", configuration.getOperation());
         LOG.debug("resolve consumer atmos attached client:{}", configuration.getClient());
 
         AtmosScheduledPollConsumer consumer;
diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
index 8db6854..5300ffa 100644
--- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
+++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/DropboxEndpoint.java
@@ -65,7 +65,7 @@ public class DropboxEndpoint extends DefaultEndpoint {
      * @throws Exception
      */
     public Producer createProducer() throws Exception {
-        LOG.trace("Resolve producer dropbox endpoint {{}}", configuration.getOperation().toString());
+        LOG.trace("Resolve producer dropbox endpoint {{}}", configuration.getOperation());
         LOG.trace("Resolve producer dropbox attached client: {}", configuration.getClient());
         if (configuration.getOperation() == DropboxOperation.put) {
             return new DropboxPutProducer(this, configuration);
@@ -89,7 +89,7 @@ public class DropboxEndpoint extends DefaultEndpoint {
      * @throws Exception
      */
     public Consumer createConsumer(Processor processor) throws Exception {
-        LOG.trace("Resolve consumer dropbox endpoint {{}}", configuration.getOperation().toString());
+        LOG.trace("Resolve consumer dropbox endpoint {{}}", configuration.getOperation());
         LOG.trace("Resolve consumer dropbox attached client: {}", configuration.getClient());
         DropboxScheduledPollConsumer consumer;
         if (this.configuration.getOperation() == DropboxOperation.search) {
diff --git a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesHelper.java b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesHelper.java
index dd4fcfc..267f520 100644
--- a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesHelper.java
+++ b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/KubernetesHelper.java
@@ -47,7 +47,7 @@ public final class KubernetesHelper {
     }
 
     private static KubernetesClient createKubernetesClient(KubernetesConfiguration configuration) {
-        LOG.debug("Create Kubernetes client with the following Configuration: {}", configuration.toString());
+        LOG.debug("Create Kubernetes client with the following Configuration: {}", configuration);
 
         ConfigBuilder builder = new ConfigBuilder();
         builder.withMasterUrl(configuration.getMasterUrl());
diff --git a/components/camel-ldif/src/main/java/org/apache/camel/component/ldif/LdifProducer.java b/components/camel-ldif/src/main/java/org/apache/camel/component/ldif/LdifProducer.java
index 632c5af..86d92f7 100644
--- a/components/camel-ldif/src/main/java/org/apache/camel/component/ldif/LdifProducer.java
+++ b/components/camel-ldif/src/main/java/org/apache/camel/component/ldif/LdifProducer.java
@@ -134,27 +134,27 @@ public class LdifProducer extends DefaultProducer {
         try {
             if (ldifEntry.isChangeAdd() || ldifEntry.isLdifContent()) {
                 if (log.isDebugEnabled()) {
-                    log.debug("attempting add of {}", ldifEntry.toString());
+                    log.debug("attempting add of {}", ldifEntry);
                 }
                 conn.add(ldifEntry.getEntry());
             } else if (ldifEntry.isChangeModify()) {
                 if (log.isDebugEnabled()) {
-                    log.debug("attempting modify of {}", ldifEntry.toString());
+                    log.debug("attempting modify of {}", ldifEntry);
                 }
                 conn.modify(ldifEntry.getDn(), ldifEntry.getModificationArray());
             } else if (ldifEntry.isChangeDelete()) {
                 if (log.isDebugEnabled()) {
-                    log.debug("attempting delete of {}", ldifEntry.toString());
+                    log.debug("attempting delete of {}", ldifEntry);
                 }
                 conn.delete(ldifEntry.getDn());
             } else if (ldifEntry.isChangeModDn()) {
                 if (log.isDebugEnabled()) {
-                    log.debug("attempting DN move of {}", ldifEntry.toString());
+                    log.debug("attempting DN move of {}", ldifEntry);
                 }
                 conn.moveAndRename(ldifEntry.getDn(), new Dn(ldifEntry.getNewRdn(), ldifEntry.getNewSuperior()), ldifEntry.isDeleteOldRdn());
             } else if (ldifEntry.isChangeModRdn()) {
                 if (log.isDebugEnabled()) {
-                    log.debug("attempting RDN move of {}", ldifEntry.toString());
+                    log.debug("attempting RDN move of {}", ldifEntry);
                 }
                 conn.rename(ldifEntry.getDn(), new Rdn(ldifEntry.getNewRdn()), ldifEntry.isDeleteOldRdn());
             }