vongosling commented on a change in pull request #683:
URL: https://github.com/apache/rocketmq-externals/pull/683#discussion_r584018855



##########
File path: 
rocketmq-console/src/main/java/org/apache/rocketmq/console/util/MsgTraceDecodeUtil.java
##########
@@ -54,12 +66,29 @@
                 pubContext.setCostTime(Integer.parseInt(line[10]));
                 
bean.setMsgType(MessageType.values()[Integer.parseInt(line[11])]);
 
-                if (line.length == 13) {
-                    pubContext.setSuccess(Boolean.parseBoolean(line[12]));
-                } else if (line.length == 14) {
-                    bean.setOffsetMsgId(line[12]);
-                    pubContext.setSuccess(Boolean.parseBoolean(line[13]));
+                // compatible with different version
+                switch (line.length) {
+                    case TRACE_MSG_PUB_V1_LEN:
+                        break;

Review comment:
       Make some tests for the switch case?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to