Fix some incorrect SLF4J logger calls

In some cases, there were an inconsistent number of formatting anchors.

In other cases, formatting anchors were used, but because the
trace/debug/info/warn/error(String, Throwable) variant was used, the
string is a message string rather than a format string.

These issues were found by SLF4J Helper for NetBeans IDE:
http://plugins.netbeans.org/plugin/72557/
This commit is contained in:
Daniel Trebbien 2017-07-28 18:58:05 -07:00 committed by Colm O hEigeartaigh
parent 057cf666a0
commit b020cba744
10 changed files with 12 additions and 12 deletions

View File

@ -228,7 +228,7 @@ public class AmqpConnection extends AmqpAbstractResource<Connection> implements
request.sync(closeTimeout, TimeUnit.MILLISECONDS);
}
} catch (IOException e) {
LOG.warn("Error caught while closing Provider: ", e.getMessage());
LOG.warn("Error caught while closing Provider: {}", e.getMessage());
} finally {
if (transport != null) {
try {

View File

@ -894,10 +894,10 @@ public class Topic extends BaseDestination implements Task {
try {
durableTopicSubscription.dispatchPending();
} catch (IOException exception) {
LOG.warn("After clear of pending, failed to dispatch to: {}, for: {}, pending: {}", new Object[]{
LOG.warn("After clear of pending, failed to dispatch to: {}, for: {}, pending: {}, exception: {}", new Object[]{
durableTopicSubscription,
destination,
durableTopicSubscription.pending }, exception);
durableTopicSubscription.pending, exception });
}
}
}

View File

@ -163,7 +163,7 @@ public class AbortSlowAckConsumerStrategy extends AbortSlowConsumerStrategy {
if (getMaxSlowDuration() > 0 && (entry.getValue().markCount * getCheckPeriod() >= getMaxSlowDuration()) ||
getMaxSlowCount() > 0 && entry.getValue().slowCount >= getMaxSlowCount()) {
LOG.trace("Transferring consumer{} to the abort list: {} slow duration = {}, slow count = {}",
LOG.trace("Transferring consumer {} to the abort list: {} slow duration = {}, slow count = {}",
new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(),
entry.getValue().markCount * getCheckPeriod(),
entry.getValue().getSlowCount() });

View File

@ -1140,7 +1140,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, Br
}
} catch (Exception e) {
LOG.warn("failed to fire forward failure advisory, cause: {}", e);
LOG.warn("failed to fire forward failure advisory, cause: {}", (Object)e);
LOG.debug("detail", e);
}
}

View File

@ -149,7 +149,7 @@ public abstract class DestinationBridge implements Service, MessageListener {
return;
} catch (Exception e) {
LOG.info("failed to forward message on attempt: {} reason: {} message: {}", new Object[]{ attempt, e, message }, e);
LOG.info("failed to forward message on attempt: {} reason: {} message: {}", new Object[]{ attempt, e, message });
}
}
}

View File

@ -259,7 +259,7 @@ public abstract class AbstractInactivityMonitor extends TransportFilter {
}
} else {
if (LOG.isTraceEnabled()) {
LOG.trace("Message received since last read check, resetting flag: ");
LOG.trace("Message received since last read check, resetting flag: {}", this);
}
}
commandReceived.set(false);

View File

@ -191,7 +191,7 @@ public class MQTTWSConnection extends WebSocketAdapter implements WebSocketListe
try {
frame = (MQTTFrame)wireFormat.unmarshal(new ByteSequence(data, offset, length));
} catch (IOException e) {
LOG.error("Could not decode incoming MQTT Frame: ", e.getMessage());
LOG.error("Could not decode incoming MQTT Frame: {}", e.getMessage());
connection.close();
}
@ -245,7 +245,7 @@ public class MQTTWSConnection extends WebSocketAdapter implements WebSocketListe
connection.close();
}
} catch (Exception e) {
LOG.error("Could not decode incoming MQTT Frame: ", e.getMessage());
LOG.error("Could not decode incoming MQTT Frame: {}", e.getMessage());
connection.close();
}
}

View File

@ -54,7 +54,7 @@ public class JmsPoolTestSupport {
brokerService.waitUntilStopped();
brokerService = null;
} catch (Exception ex) {
LOG.warn("Suppress error on shutdown: {}", ex);
LOG.warn("Suppress error on shutdown: {}", (Object)ex);
}
}

View File

@ -753,7 +753,7 @@ public class MQTTProtocolConverter {
if (response.isException()) {
Throwable error = ((ExceptionResponse) response).getException();
LOG.warn("Failed to send MQTT Publish: {}: {}", command, error.getMessage());
LOG.trace("Error trace: {}", error);
LOG.trace("Error trace: {}", (Object)error);
}
switch (command.qos()) {

View File

@ -355,4 +355,4 @@ public class ActiveMQResourceAdapter extends ActiveMQConnectionSupport implement
}
}
}