[activemq] branch activemq-5.15.x updated: Fix unused format arguments in log messages.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[activemq] branch activemq-5.15.x updated: Fix unused format arguments in log messages.

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

jbonofre pushed a commit to branch activemq-5.15.x
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/activemq-5.15.x by this push:
     new 4a26488  Fix unused format arguments in log messages.
4a26488 is described below

commit 4a264881c073b15d27ac456e4698b55877b49ca7
Author: Pascal Schumacher <[hidden email]>
AuthorDate: Mon Feb 10 20:05:21 2020 +0100

    Fix unused format arguments in log messages.
   
    (cherry picked from commit 6764511fa1b7efc8df097514f991ff3950f618f1)
---
 .../java/org/apache/activemq/transport/amqp/protocol/AmqpSender.java  | 2 +-
 .../src/main/java/org/apache/activemq/broker/TransportConnection.java | 2 +-
 .../src/main/java/org/apache/activemq/broker/region/Queue.java        | 2 +-
 .../org/apache/activemq/transport/discovery/DiscoveryTransport.java   | 4 ++--
 .../java/org/apache/activemq/transport/tcp/TcpTransportFactory.java   | 2 +-
 .../org/apache/activemq/util/ClassLoadingAwareObjectInputStream.java  | 4 ++--
 .../org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java     | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSender.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSender.java
index 9b75c1a..ab968b8 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSender.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSender.java
@@ -279,7 +279,7 @@ public class AmqpSender extends AmqpAbstractLink<Sender> {
                 // Rejection is a terminal outcome, we poison the message for dispatch to
                 // the DLQ.  If a custom redelivery policy is used on the broker the message
                 // can still be redelivered based on the configation of that policy.
-                LOG.trace("onDelivery: Rejected state = {}, message poisoned.", state, md.getRedeliveryCounter());
+                LOG.trace("onDelivery: Rejected state = {}, message poisoned.", state);
                 settle(delivery, MessageAck.POSION_ACK_TYPE);
             } else if (state instanceof Released) {
                 LOG.trace("onDelivery: Released state = {}", state);
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
index 27b6072..b1e1dce 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
@@ -586,7 +586,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
         if (consumerExchange != null) {
             broker.acknowledge(consumerExchange, ack);
         } else if (ack.isInTransaction()) {
-            LOG.warn("no matching consumer, ignoring ack {}", consumerExchange, ack);
+            LOG.warn("no matching consumer {}, ignoring ack {}", consumerExchange, ack);
         }
         return null;
     }
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
index ecd5e89..86471ec 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
@@ -2031,7 +2031,7 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
                             ConnectionContext connectionContext = createConnectionContext();
                             dropMessage(ref);
                             if (gotToTheStore(ref.getMessage())) {
-                                LOG.debug("Duplicate message {} from cursor, removing from store", this, ref.getMessage());
+                                LOG.debug("Duplicate message {} from cursor, removing from store", ref.getMessage());
                                 store.removeMessage(connectionContext, new MessageAck(ref.getMessage(), MessageAck.POSION_ACK_TYPE, 1));
                             }
                             broker.getRoot().sendToDeadLetterQueue(connectionContext, ref.getMessage(), null, new Throwable("duplicate paged in from cursor for " + destination));
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/discovery/DiscoveryTransport.java b/activemq-client/src/main/java/org/apache/activemq/transport/discovery/DiscoveryTransport.java
index a79fc3e..d727988 100644
--- a/activemq-client/src/main/java/org/apache/activemq/transport/discovery/DiscoveryTransport.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/discovery/DiscoveryTransport.java
@@ -112,7 +112,7 @@ public class DiscoveryTransport extends TransportFilter implements DiscoveryList
             try {
                 ((Suspendable)discoveryAgent).suspend();
             } catch (Exception e) {
-                LOG.warn("Exception suspending discoverAgent: ", discoveryAgent);
+                LOG.warn("Exception suspending discoverAgent: {}", discoveryAgent);
             }
         }
         super.transportResumed();
@@ -124,7 +124,7 @@ public class DiscoveryTransport extends TransportFilter implements DiscoveryList
             try {
                 ((Suspendable)discoveryAgent).resume();
             } catch (Exception e) {
-                LOG.warn("Exception resuming discoverAgent: ", discoveryAgent);
+                LOG.warn("Exception resuming discoverAgent: {}", discoveryAgent);
             }
         }
         super.transportInterupted();
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
index ae555fd..b6f42e6 100644
--- a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
@@ -133,7 +133,7 @@ public class TcpTransportFactory extends TransportFactory {
                 String localString = location.getScheme() + ":/" + path;
                 localLocation = new URI(localString);
             } catch (Exception e) {
-                LOG.warn("path isn't a valid local location for TcpTransport to use", e.getMessage());
+                LOG.warn("path isn't a valid local location for TcpTransport to use: {}", e.getMessage());
                 if(LOG.isDebugEnabled()) {
                     LOG.debug("Failure detail", e);
                 }
diff --git a/activemq-client/src/main/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStream.java b/activemq-client/src/main/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStream.java
index 95ad9ee..d6a50a1 100644
--- a/activemq-client/src/main/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStream.java
+++ b/activemq-client/src/main/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStream.java
@@ -118,7 +118,7 @@ public class ClassLoadingAwareObjectInputStream extends ObjectInputStream {
         // check for simple types first
         final Class<?> clazz = loadSimpleType(className);
         if (clazz != null) {
-            LOG.trace("Loaded class: {} as simple type -> ", className, clazz);
+            LOG.trace("Loaded class: {} as simple type -> {}", className, clazz);
             return clazz;
         }
 
@@ -128,7 +128,7 @@ public class ClassLoadingAwareObjectInputStream extends ObjectInputStream {
             try {
                 Class<?> answer = Class.forName(className, false, loader);
                 if (LOG.isTraceEnabled()) {
-                    LOG.trace("Loaded class: {} using classloader: {} -> ", new Object[]{className, cl, answer});
+                    LOG.trace("Loaded class: {} using classloader: {} -> {}", className, cl, answer);
                 }
                 return answer;
             } catch (ClassNotFoundException e) {
diff --git a/activemq-mqtt/src/main/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java b/activemq-mqtt/src/main/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java
index 98453e0..d1cc80e 100644
--- a/activemq-mqtt/src/main/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java
+++ b/activemq-mqtt/src/main/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java
@@ -748,7 +748,7 @@ public class MQTTProtocolConverter {
                 public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
                     if (response.isException()) {
                         Throwable error = ((ExceptionResponse) response).getException();
-                        LOG.warn("Failed to send MQTT Publish: ", command, error.getMessage());
+                        LOG.warn("Failed to send MQTT Publish: {}: {}", command, error.getMessage());
                         LOG.trace("Error trace: {}", error);
                     }