Remove redundant toString calls
This commit is contained in:
parent
038efc60d2
commit
3dc3e8520d
|
@ -115,7 +115,7 @@ public final class ObjectNameBuilder {
|
|||
* @see DivertControl
|
||||
*/
|
||||
public ObjectName getDivertObjectName(final String name) throws Exception {
|
||||
return createObjectName(ObjectNameBuilder.CORE_MODULE, "Divert", name.toString());
|
||||
return createObjectName(ObjectNameBuilder.CORE_MODULE, "Divert", name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -267,7 +267,7 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl {
|
|||
String subName = null;
|
||||
|
||||
if (queue.isDurable()) {
|
||||
Pair<String, String> pair = ActiveMQDestination.decomposeQueueNameForDurableSubscription(queue.getName().toString());
|
||||
Pair<String, String> pair = ActiveMQDestination.decomposeQueueNameForDurableSubscription(queue.getName());
|
||||
clientID = pair.getA();
|
||||
subName = pair.getB();
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ public class JMSTopicControlImpl extends StandardMBean implements TopicControl {
|
|||
String subName = null;
|
||||
|
||||
if (queue.isDurable() && !queue.getName().startsWith(ResourceNames.JMS_TOPIC)) {
|
||||
Pair<String, String> pair = ActiveMQDestination.decomposeQueueNameForDurableSubscription(queue.getName().toString());
|
||||
Pair<String, String> pair = ActiveMQDestination.decomposeQueueNameForDurableSubscription(queue.getName());
|
||||
clientID = pair.getA();
|
||||
subName = pair.getB();
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ public class MQTTPublishManager {
|
|||
}
|
||||
|
||||
private void sendServerMessage(int messageId, ServerMessageImpl message, int deliveryCount, int qos) {
|
||||
String address = MQTTUtil.convertCoreAddressFilterToMQTT(message.getAddress().toString()).toString();
|
||||
String address = MQTTUtil.convertCoreAddressFilterToMQTT(message.getAddress().toString());
|
||||
|
||||
ByteBuf payload = message.getBodyBufferDuplicate().byteBuf();
|
||||
|
||||
|
|
|
@ -71,10 +71,10 @@ public class MQTTUtil {
|
|||
}
|
||||
|
||||
public static String convertCoreAddressFilterToMQTT(String filter) {
|
||||
if (filter.startsWith(MQTT_RETAIN_ADDRESS_PREFIX.toString())) {
|
||||
if (filter.startsWith(MQTT_RETAIN_ADDRESS_PREFIX)) {
|
||||
filter = filter.substring(MQTT_RETAIN_ADDRESS_PREFIX.length(), filter.length());
|
||||
}
|
||||
else if (filter.startsWith(MQTT_ADDRESS_PREFIX.toString())) {
|
||||
else if (filter.startsWith(MQTT_ADDRESS_PREFIX)) {
|
||||
filter = filter.substring(MQTT_ADDRESS_PREFIX.length(), filter.length());
|
||||
}
|
||||
return swapMQTTAndCoreWildCards(filter);
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ProtonServerReceiverContext extends AbstractProtonReceiverContext {
|
|||
catch (Exception e) {
|
||||
throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e);
|
||||
}
|
||||
target.setAddress(queue.toString());
|
||||
target.setAddress(queue);
|
||||
}
|
||||
else {
|
||||
//if not dynamic then we use the targets address as the address to forward the messages to, however there has to
|
||||
|
|
|
@ -314,7 +314,7 @@ public class StompDecoder {
|
|||
headers.put(headerName, headerValue);
|
||||
|
||||
if (headerName.equals(Stomp.Headers.CONTENT_LENGTH)) {
|
||||
contentLength = Integer.parseInt(headerValue.toString());
|
||||
contentLength = Integer.parseInt(headerValue);
|
||||
}
|
||||
|
||||
whiteSpaceOnly = true;
|
||||
|
|
|
@ -463,7 +463,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
|
|||
|
||||
@Override
|
||||
public String getFirstMessageAsJSON() throws Exception {
|
||||
return toJSON(getFirstMessage()).toString();
|
||||
return toJSON(getFirstMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1127,7 +1127,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
int sessionCount = 0;
|
||||
|
||||
for (Entry<String, ServerSession> sessionEntry : sessions.entrySet()) {
|
||||
if (sessionEntry.getValue().getUsername().toString().equals(username)) {
|
||||
if (sessionEntry.getValue().getUsername().equals(username)) {
|
||||
sessionCount++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue