activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/2] activemq-artemis git commit: Remove redundant toString calls
Date Mon, 11 Apr 2016 20:54:39 GMT
Remove redundant toString calls


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3dc3e852
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3dc3e852
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3dc3e852

Branch: refs/heads/master
Commit: 3dc3e8520dce9d7e1d65f7d7c515ea1683fc6825
Parents: 038efc6
Author: Ville Skyttä <ville.skytta@iki.fi>
Authored: Sun Apr 10 19:32:20 2016 +0300
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Apr 11 16:54:30 2016 -0400

----------------------------------------------------------------------
 .../activemq/artemis/api/core/management/ObjectNameBuilder.java  | 2 +-
 .../artemis/jms/management/impl/JMSTopicControlImpl.java         | 4 ++--
 .../activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java  | 2 +-
 .../org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java | 4 ++--
 .../proton/plug/context/server/ProtonServerReceiverContext.java  | 2 +-
 .../activemq/artemis/core/protocol/stomp/StompDecoder.java       | 2 +-
 .../activemq/artemis/core/management/impl/QueueControlImpl.java  | 2 +-
 .../activemq/artemis/core/server/impl/ActiveMQServerImpl.java    | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3dc3e852/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
index 6f40508..fd3d718 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
@@ -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);
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3dc3e852/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSTopicControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSTopicControlImpl.java
b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSTopicControlImpl.java
index e226e7a..cfafe94 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSTopicControlImpl.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSTopicControlImpl.java
@@ -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();
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3dc3e852/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java
b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java
index b0df5a2..19bbff8 100644
--- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java
+++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java
@@ -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();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3dc3e852/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java
b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java
index f2a6971..aa2262a 100644
--- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java
+++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtil.java
@@ -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);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3dc3e852/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
index c0c1ea3..0406919 100644
--- a/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
+++ b/artemis-protocols/artemis-proton-plug/src/main/java/org/proton/plug/context/server/ProtonServerReceiverContext.java
@@ -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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3dc3e852/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
index c1a3093..427509f 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
@@ -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;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3dc3e852/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
index 8748c22..bcd0256 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
@@ -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

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3dc3e852/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index d7eda42..96f661a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -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++;
          }
       }


Mime
View raw message