From 214a1dc1ebd90806c7ba20762ee672ec11e4eb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 21 Jul 2015 19:08:41 +0300 Subject: [PATCH] Use StringBuilder instead of StringBuffer on STOMP encode --- .../activemq/artemis/core/protocol/stomp/StompFrame.java | 4 ++-- .../artemis/core/protocol/stomp/v11/StompFrameV11.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java index 1d37194d35..0193fdb290 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java @@ -117,7 +117,7 @@ public class StompFrame return buffer; } - StringBuffer head = new StringBuffer(); + StringBuilder head = new StringBuilder(); head.append(command); head.append(Stomp.NEWLINE); // Output the headers. @@ -148,7 +148,7 @@ public class StompFrame return buffer; } - protected void encodeHeaders(StringBuffer head) + protected void encodeHeaders(StringBuilder head) { for (Map.Entry header : headers.entrySet()) { diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java index 2a38d40f0a..783c8454c9 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameV11.java @@ -39,7 +39,7 @@ public class StompFrameV11 extends StompFrame } @Override - protected void encodeHeaders(StringBuffer head) + protected void encodeHeaders(StringBuilder head) { for (Header h : allHeaders) {