rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huan...@apache.org
Subject [rocketmq] branch develop updated: [ISSUE 3333] Remove commons-codes dependency (#3334)
Date Fri, 10 Sep 2021 07:19:32 GMT
This is an automated email from the ASF dual-hosted git repository.

huangli pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 7519a53  [ISSUE 3333] Remove commons-codes dependency (#3334)
7519a53 is described below

commit 7519a53c521a8c600cd80f1d4ea76f66efd0eebb
Author: huangli <areyouok@gmail.com>
AuthorDate: Fri Sep 10 15:19:26 2021 +0800

    [ISSUE 3333] Remove commons-codes dependency (#3334)
---
 client/pom.xml                                                        | 4 ----
 client/src/main/java/org/apache/rocketmq/client/trace/TraceView.java  | 4 ++--
 .../src/test/java/org/apache/rocketmq/client/trace/TraceViewTest.java | 4 ++--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/client/pom.xml b/client/pom.xml
index 9387eb3..db5bb19 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -48,10 +48,6 @@
             <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-        </dependency>
-        <dependency>
             <groupId>io.opentracing</groupId>
             <artifactId>opentracing-api</artifactId>
             <version>0.33.0</version>
diff --git a/client/src/main/java/org/apache/rocketmq/client/trace/TraceView.java b/client/src/main/java/org/apache/rocketmq/client/trace/TraceView.java
index e78d37a..7601221 100644
--- a/client/src/main/java/org/apache/rocketmq/client/trace/TraceView.java
+++ b/client/src/main/java/org/apache/rocketmq/client/trace/TraceView.java
@@ -17,9 +17,9 @@
 
 package org.apache.rocketmq.client.trace;
 
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.commons.codec.Charsets;
 import org.apache.rocketmq.common.message.MessageExt;
 
 public class TraceView {
@@ -40,7 +40,7 @@ public class TraceView {
 
     public static List<TraceView> decodeFromTraceTransData(String key, MessageExt messageExt)
{
         List<TraceView> messageTraceViewList = new ArrayList<TraceView>();
-        String messageBody = new String(messageExt.getBody(), Charsets.UTF_8);
+        String messageBody = new String(messageExt.getBody(), StandardCharsets.UTF_8);
         if (messageBody == null || messageBody.length() <= 0) {
             return messageTraceViewList;
         }
diff --git a/client/src/test/java/org/apache/rocketmq/client/trace/TraceViewTest.java b/client/src/test/java/org/apache/rocketmq/client/trace/TraceViewTest.java
index b1fdbaf..0397db2 100644
--- a/client/src/test/java/org/apache/rocketmq/client/trace/TraceViewTest.java
+++ b/client/src/test/java/org/apache/rocketmq/client/trace/TraceViewTest.java
@@ -17,12 +17,12 @@
 
 package org.apache.rocketmq.client.trace;
 
-import org.apache.commons.codec.Charsets;
 import org.apache.rocketmq.common.message.MessageExt;
 import org.apache.rocketmq.common.message.MessageType;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 public class TraceViewTest {
@@ -46,7 +46,7 @@ public class TraceViewTest {
             .append(true).append(TraceConstants.FIELD_SPLITOR)
             .toString();
         MessageExt message = new MessageExt();
-        message.setBody(messageBody.getBytes(Charsets.UTF_8));
+        message.setBody(messageBody.getBytes(StandardCharsets.UTF_8));
         String key = "AC1415116D1418B4AAC217FE1B4E0000";
         List<TraceView> traceViews = TraceView.decodeFromTraceTransData(key, message);
         Assert.assertEquals(traceViews.size(), 1);

Mime
View raw message