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: Use StandardCharsets more
Date Mon, 16 May 2016 16:12:00 GMT
Use StandardCharsets more


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

Branch: refs/heads/master
Commit: 81956e1716ee69247131a3877829ad174f9a79f6
Parents: 5778609
Author: Ville Skyttä <ville.skytta@iki.fi>
Authored: Fri May 13 21:47:44 2016 +0300
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon May 16 12:09:46 2016 -0400

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/cli/commands/Create.java |  3 ++-
 .../proton/converter/message/InboundTransformer.java     |  4 +++-
 .../converter/message/JMSMappingOutboundTransformer.java |  3 ++-
 .../artemis/jms/example/StompWebSocketExample.java       |  2 +-
 .../activemq/artemis/jms/example/StompExample.java       |  2 +-
 .../activemq/artemis/jms/example/StompExample.java       |  5 +++--
 .../apache/activemq/command/MessageCompressionTest.java  |  7 ++++---
 .../activemq/network/CompressionOverNetworkTest.java     |  3 ++-
 .../org/apache/activemq/usage/StoreUsageLimitsTest.java  |  3 ++-
 .../usecases/RequestReplyNoAdvisoryNetworkTest.java      |  3 ++-
 .../openwire/interop/CompressedInteropTest.java          |  6 ++++--
 .../integration/openwire/interop/GeneralInteropTest.java |  5 +++--
 .../tests/integration/stomp/StompOverWebsocketTest.java  |  3 +--
 .../tests/integration/vertx/ActiveMQVertxUnitTest.java   | 11 ++++++-----
 14 files changed, 36 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
index e0b274c..58938db 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
@@ -27,6 +27,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.nio.charset.StandardCharsets;
 import java.text.DecimalFormat;
 import java.util.HashMap;
 import java.util.Map;
@@ -818,7 +819,7 @@ public class Create extends InputAbstract {
       try (InputStream in = openStream(source)) {
          copy(in, out);
       }
-      return new String(out.toByteArray(), "UTF-8");
+      return new String(out.toByteArray(), StandardCharsets.UTF_8);
    }
 
    private void write(String source) throws IOException {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
index 3a58038..71f75c4 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/InboundTransformer.java
@@ -34,6 +34,8 @@ import org.apache.qpid.proton.amqp.messaging.Properties;
 import javax.jms.DeliveryMode;
 import javax.jms.JMSException;
 import javax.jms.Message;
+
+import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.Set;
 
@@ -201,7 +203,7 @@ public abstract class InboundTransformer {
          }
          Binary userId = properties.getUserId();
          if (userId != null) {
-            vendor.setJMSXUserID(jms, new String(userId.getArray(), userId.getArrayOffset(),
userId.getLength(), "UTF-8"));
+            vendor.setJMSXUserID(jms, new String(userId.getArray(), userId.getArrayOffset(),
userId.getLength(), StandardCharsets.UTF_8));
          }
          if (properties.getTo() != null) {
             jms.setJMSDestination(vendor.createDestination(properties.getTo()));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
index 7babcf3..73dc42b 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/converter/message/JMSMappingOutboundTransformer.java
@@ -48,6 +48,7 @@ import javax.jms.TemporaryTopic;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Enumeration;
@@ -207,7 +208,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer
{
          }
          else if (key.startsWith("JMSXUserID")) {
             String value = msg.getStringProperty(key);
-            props.setUserId(new Binary(value.getBytes("UTF-8")));
+            props.setUserId(new Binary(value.getBytes(StandardCharsets.UTF_8)));
          }
          else if (key.startsWith("JMSXGroupID")) {
             String value = msg.getStringProperty(key);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/examples/protocols/stomp/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
b/examples/protocols/stomp/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
index d784e6b..5ee9187 100644
--- a/examples/protocols/stomp/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
+++ b/examples/protocols/stomp/stomp-websockets/src/main/java/org/apache/activemq/artemis/jms/example/StompWebSocketExample.java
@@ -49,7 +49,7 @@ public class StompWebSocketExample {
          // use JMS bytes message with UTF-8 String to send a text to Stomp clients
          String text = "message sent from a Java application at " + new Date();
          //BytesMessage message = session.createBytesMessage();
-         //message.writeBytes(text.getBytes("UTF-8"));
+         //message.writeBytes(text.getBytes(StandardCharsets.UTF_8));
          TextMessage message = session.createTextMessage(text);
          System.out.println("Sent message: " + text);
          System.out.println("Open up the chat/index.html file in a browser and press enter");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
b/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index e7ea406..78fed5e 100644
--- a/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/protocols/stomp/stomp/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -123,7 +123,7 @@ public class StompExample {
       int nbytes = inputStream.read(bytes);
       byte[] data = new byte[nbytes];
       System.arraycopy(bytes, 0, data, 0, data.length);
-      String resp = new String(data, "UTF-8");
+      String resp = new String(data, StandardCharsets.UTF_8);
       System.out.println("Got response from server: " + resp);
       return resp;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
b/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
index 116e464..318de16 100644
--- a/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
+++ b/examples/protocols/stomp/stomp1.2/src/main/java/org/apache/activemq/artemis/jms/example/StompExample.java
@@ -19,6 +19,7 @@ package org.apache.activemq.artemis.jms.example;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.Socket;
+import java.nio.charset.StandardCharsets;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -111,7 +112,7 @@ public class StompExample {
    }
 
    private static void sendFrame(Socket socket, String data) throws Exception {
-      byte[] bytes = data.getBytes("UTF-8");
+      byte[] bytes = data.getBytes(StandardCharsets.UTF_8);
       OutputStream outputStream = socket.getOutputStream();
       for (int i = 0; i < bytes.length; i++) {
          outputStream.write(bytes[i]);
@@ -127,7 +128,7 @@ public class StompExample {
       byte[] data = new byte[size];
       System.arraycopy(buffer, 0, data, 0, size);
 
-      String frame = new String(data, "UTF-8");
+      String frame = new String(data, StandardCharsets.UTF_8);
       return frame;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/MessageCompressionTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/MessageCompressionTest.java
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/MessageCompressionTest.java
index 4a3ba42..01dbe6c 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/MessageCompressionTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/MessageCompressionTest.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.command;
 
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 
 import javax.jms.BytesMessage;
 import javax.jms.JMSException;
@@ -83,10 +84,10 @@ public class MessageCompressionTest extends TestCase {
       sendTestBytesMessage(factory, TEXT);
       ActiveMQBytesMessage message = receiveTestBytesMessage(factory);
       int compressedSize = message.getContent().getLength();
-      byte[] bytes = new byte[TEXT.getBytes("UTF8").length];
+      byte[] bytes = new byte[TEXT.getBytes(StandardCharsets.UTF_8).length];
       message.readBytes(bytes);
       assertTrue(message.readBytes(new byte[255]) == -1);
-      String rcvString = new String(bytes, "UTF8");
+      String rcvString = new String(bytes, StandardCharsets.UTF_8);
       assertEquals(TEXT, rcvString);
       assertTrue(message.isCompressed());
 
@@ -326,7 +327,7 @@ public class MessageCompressionTest extends TestCase {
       Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
       MessageProducer producer = session.createProducer(queue);
       BytesMessage bytesMessage = session.createBytesMessage();
-      bytesMessage.writeBytes(message.getBytes("UTF8"));
+      bytesMessage.writeBytes(message.getBytes(StandardCharsets.UTF_8));
       producer.send(bytesMessage);
       connection.close();
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java
index d95a82b..73cecb8 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/CompressionOverNetworkTest.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.net.URI;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
@@ -136,7 +137,7 @@ public class CompressionOverNetworkTest {
          payload.append(UUID.randomUUID().toString());
       }
 
-      byte[] bytes = payload.toString().getBytes("UTF-8");
+      byte[] bytes = payload.toString().getBytes(StandardCharsets.UTF_8);
 
       BytesMessage test = localSession.createBytesMessage();
       test.writeBytes(bytes);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java
index 49d95fd..72dcd01 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usage/StoreUsageLimitsTest.java
@@ -22,6 +22,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.activemq.EmbeddedBrokerTestSupport;
 import org.apache.activemq.broker.BrokerService;
@@ -56,7 +57,7 @@ public class StoreUsageLimitsTest extends EmbeddedBrokerTestSupport {
       boolean foundUsage = false;
 
       try {
-         br = new BufferedReader(new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8")));
+         br = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8));
          String line = null;
          while ((line = br.readLine()) != null) {
             if (line.contains(new String(Long.toString(Long.MAX_VALUE / (1024 * 1024))))
&& line.contains(limitsLogLevel.toUpperCase())) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/RequestReplyNoAdvisoryNetworkTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/RequestReplyNoAdvisoryNetworkTest.java
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/RequestReplyNoAdvisoryNetworkTest.java
index 0823a58..b4960be 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/RequestReplyNoAdvisoryNetworkTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/RequestReplyNoAdvisoryNetworkTest.java
@@ -24,6 +24,7 @@ import java.net.URL;
 import java.net.URLConnection;
 import java.net.URLStreamHandler;
 import java.net.URLStreamHandlerFactory;
+import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.Vector;
 
@@ -111,7 +112,7 @@ public class RequestReplyNoAdvisoryNetworkTest extends JmsMultipleBrokersTestSup
 
                         @Override
                         public InputStream getInputStream() throws IOException {
-                           return new ByteArrayInputStream(xmlConfigString.replace("%HOST%",
url.getFile()).getBytes("UTF-8"));
+                           return new ByteArrayInputStream(xmlConfigString.replace("%HOST%",
url.getFile()).getBytes(StandardCharsets.UTF_8));
                         }
                      };
                   }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/CompressedInteropTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/CompressedInteropTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/CompressedInteropTest.java
index 2123f53..b0a1237 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/CompressedInteropTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/CompressedInteropTest.java
@@ -22,6 +22,8 @@ import org.apache.activemq.command.ActiveMQDestination;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.nio.charset.StandardCharsets;
+
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
 import javax.jms.MapMessage;
@@ -215,11 +217,11 @@ public class CompressedInteropTest extends BasicOpenWireTest {
    private void receiveBytesMessageUsingCore() throws Exception {
       BytesMessage bytesMessage = (BytesMessage) receiveMessageUsingCore();
 
-      byte[] bytes = new byte[TEXT.getBytes("UTF8").length];
+      byte[] bytes = new byte[TEXT.getBytes(StandardCharsets.UTF_8).length];
       bytesMessage.readBytes(bytes);
       assertTrue(bytesMessage.readBytes(new byte[255]) == -1);
 
-      String rcvString = new String(bytes, "UTF8");
+      String rcvString = new String(bytes, StandardCharsets.UTF_8);
       assertEquals(TEXT, rcvString);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
index c186ed5..f82f112 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
@@ -35,6 +35,7 @@ import javax.jms.Session;
 import javax.jms.StreamMessage;
 import javax.jms.TextMessage;
 import java.io.Serializable;
+import java.nio.charset.StandardCharsets;
 
 /**
  * This test covers interactions between core clients and
@@ -132,7 +133,7 @@ public class GeneralInteropTest extends BasicOpenWireTest {
       assertEquals("hello streammessage", streamMessage.readString());
 
       //bytes messages
-      final byte[] bytesData = text.getBytes("UTF-8");
+      final byte[] bytesData = text.getBytes(StandardCharsets.UTF_8);
       sendBytesMessageUsingCoreJms(queueName, bytesData);
 
       BytesMessage bytesMessage = (BytesMessage) consumer.receive(5000);
@@ -441,7 +442,7 @@ public class GeneralInteropTest extends BasicOpenWireTest {
          assertEquals("hello streammessage", streamMessage.readString());
 
          //bytes messages
-         final byte[] bytesData = text.getBytes("UTF-8");
+         final byte[] bytesData = text.getBytes(StandardCharsets.UTF_8);
          sendBytesMessageUsingOpenWire(bytesData);
 
          BytesMessage bytesMessage = (BytesMessage) coreConsumer.receive(5000);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompOverWebsocketTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompOverWebsocketTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompOverWebsocketTest.java
index 4d900ba..d665cc2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompOverWebsocketTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompOverWebsocketTest.java
@@ -18,7 +18,6 @@ package org.apache.activemq.artemis.tests.integration.stomp;
 
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Collection;
@@ -148,7 +147,7 @@ public class StompOverWebsocketTest extends StompTest {
 
    protected WebSocketFrame createFrame(String msg) {
       if (useBinaryFrames) {
-         return new BinaryWebSocketFrame(Unpooled.copiedBuffer(msg, Charset.forName("UTF-8")));
+         return new BinaryWebSocketFrame(Unpooled.copiedBuffer(msg, StandardCharsets.UTF_8));
       }
       else {
          return new TextWebSocketFrame(msg);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/81956e17/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
index c1ffec5..e64bfa8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/vertx/ActiveMQVertxUnitTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.vertx;
 
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
@@ -163,7 +164,7 @@ public class ActiveMQVertxUnitTest extends ActiveMQTestBase {
       assertEquals(greeting, body);
 
       //send a Buffer message
-      final byte[] content = greeting.getBytes("UTF-8");
+      final byte[] content = greeting.getBytes(StandardCharsets.UTF_8);
       Buffer buffer = new Buffer(content);
       vertx.eventBus().send(incomingVertxAddress1, buffer);
 
@@ -383,7 +384,7 @@ public class ActiveMQVertxUnitTest extends ActiveMQTestBase {
       handler.checkStringMessageReceived(greeting);
 
       //send a Buffer message
-      final byte[] content = greeting.getBytes("UTF-8");
+      final byte[] content = greeting.getBytes(StandardCharsets.UTF_8);
       Buffer buffer = new Buffer(content);
       vertx.eventBus().send(incomingVertxAddress2, buffer);
 
@@ -395,7 +396,7 @@ public class ActiveMQVertxUnitTest extends ActiveMQTestBase {
 
       handler.checkBooleanMessageReceived(boolValue);
 
-      byte[] byteArray = greeting.getBytes("UTF-8");
+      byte[] byteArray = greeting.getBytes(StandardCharsets.UTF_8);
       vertx.eventBus().send(incomingVertxAddress2, byteArray);
 
       handler.checkByteArrayMessageReceived(byteArray);
@@ -517,7 +518,7 @@ public class ActiveMQVertxUnitTest extends ActiveMQTestBase {
       handler2.checkStringMessageReceived(greeting);
 
       //send a Buffer message
-      final byte[] content = greeting.getBytes("UTF-8");
+      final byte[] content = greeting.getBytes(StandardCharsets.UTF_8);
       Buffer buffer = new Buffer(content);
       vertx.eventBus().send(incomingVertxAddress3, buffer);
 
@@ -531,7 +532,7 @@ public class ActiveMQVertxUnitTest extends ActiveMQTestBase {
       handler1.checkBooleanMessageReceived(boolValue);
       handler2.checkBooleanMessageReceived(boolValue);
 
-      byte[] byteArray = greeting.getBytes("UTF-8");
+      byte[] byteArray = greeting.getBytes(StandardCharsets.UTF_8);
       vertx.eventBus().send(incomingVertxAddress3, byteArray);
 
       handler1.checkByteArrayMessageReceived(byteArray);


Mime
View raw message