liketic commented on a change in pull request #1378: Simplify string 
concatenation in log
URL: https://github.com/apache/incubator-dubbo/pull/1378#discussion_r179164620
 
 

 ##########
 File path: 
dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/DecodeHandler.java
 ##########
 @@ -55,16 +55,11 @@ private void decode(Object message) {
             try {
                 ((Decodeable) message).decode();
                 if (log.isDebugEnabled()) {
-                    log.debug(new StringBuilder(32).append("Decode decodeable 
message ")
-                            .append(message.getClass().getName()).toString());
+                    log.debug("Decode decodeable message " + 
message.getClass().getName());
                 }
             } catch (Throwable e) {
                 if (log.isWarnEnabled()) {
-                    log.warn(
-                            new StringBuilder(32)
-                                    .append("Call Decodeable.decode failed: ")
-                                    .append(e.getMessage()).toString(),
-                            e);
+                    log.warn("Call Decodeable.decode failed: " + 
e.getMessage(), e);
 
 Review comment:
   Thanks @beiwei30 ! That's my mistake. The test is uncorrect. The two strings 
cannot both be constants. 👍 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to