beiwei30 closed pull request #1388: Remove unnecessary StringBuilder
URL: https://github.com/apache/incubator-dubbo/pull/1388
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/merger/ArrayMerger.java
 
b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/merger/ArrayMerger.java
index 873138974f..443a51f2b0 100644
--- 
a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/merger/ArrayMerger.java
+++ 
b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/merger/ArrayMerger.java
@@ -34,9 +34,7 @@
             if (item != null && item.getClass().isArray()) {
                 totalLen += Array.getLength(item);
             } else {
-                throw new IllegalArgumentException(
-                        new StringBuilder(32).append(i + 1)
-                                .append("th argument is not an 
array").toString());
+                throw new IllegalArgumentException(i + 1 + "th argument is not 
an array");
             }
         }
 
diff --git 
a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/MergeableClusterInvoker.java
 
b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/MergeableClusterInvoker.java
index 62372108f8..048d25594b 100644
--- 
a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/MergeableClusterInvoker.java
+++ 
b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/MergeableClusterInvoker.java
@@ -99,21 +99,14 @@ public Result call() throws Exception {
             try {
                 Result r = future.get(timeout, TimeUnit.MILLISECONDS);
                 if (r.hasException()) {
-                    log.error(new StringBuilder(32).append("Invoke ")
-                                    
.append(getGroupDescFromServiceKey(entry.getKey()))
-                                    .append(" failed: ")
-                                    
.append(r.getException().getMessage()).toString(),
+                    log.error("Invoke " + 
getGroupDescFromServiceKey(entry.getKey()) + 
+                                    " failed: " + 
r.getException().getMessage(), 
                             r.getException());
                 } else {
                     resultList.add(r);
                 }
             } catch (Exception e) {
-                throw new RpcException(new StringBuilder(32)
-                        .append("Failed to invoke service ")
-                        .append(entry.getKey())
-                        .append(": ")
-                        .append(e.getMessage()).toString(),
-                        e);
+                throw new RpcException("Failed to invoke service " + 
entry.getKey() + ": " + e.getMessage(), e);
             }
         }
 
@@ -133,13 +126,8 @@ public Result call() throws Exception {
             try {
                 method = returnType.getMethod(merger, returnType);
             } catch (NoSuchMethodException e) {
-                throw new RpcException(new StringBuilder(32)
-                        .append("Can not merge result because missing method [ 
")
-                        .append(merger)
-                        .append(" ] in class [ ")
-                        .append(returnType.getClass().getName())
-                        .append(" ]")
-                        .toString());
+                throw new RpcException("Can not merge result because missing 
method [ " + merger + " ] in class [ " + 
+                        returnType.getClass().getName() + " ]");
             }
             if (!Modifier.isPublic(method.getModifiers())) {
                 method.setAccessible(true);
@@ -157,11 +145,7 @@ public Result call() throws Exception {
                     }
                 }
             } catch (Exception e) {
-                throw new RpcException(
-                        new StringBuilder(32)
-                                .append("Can not merge result: ")
-                                .append(e.getMessage()).toString(),
-                        e);
+                throw new RpcException("Can not merge result: " + 
e.getMessage(), e);
             }
         } else {
             Merger resultMerger;
@@ -203,8 +187,7 @@ public void destroy() {
     private String getGroupDescFromServiceKey(String key) {
         int index = key.indexOf("/");
         if (index > 0) {
-            return new StringBuilder(32).append("group [ ")
-                    .append(key.substring(0, index)).append(" ]").toString();
+            return "group [ " + key.substring(0, index) + " ]";
         }
         return key;
     }
diff --git 
a/dubbo-cluster/src/test/java/com/alibaba/dubbo/rpc/cluster/support/MergeableClusterInvokerTest.java
 
b/dubbo-cluster/src/test/java/com/alibaba/dubbo/rpc/cluster/support/MergeableClusterInvokerTest.java
index 3da49dada2..c8d8e39133 100644
--- 
a/dubbo-cluster/src/test/java/com/alibaba/dubbo/rpc/cluster/support/MergeableClusterInvokerTest.java
+++ 
b/dubbo-cluster/src/test/java/com/alibaba/dubbo/rpc/cluster/support/MergeableClusterInvokerTest.java
@@ -71,9 +71,7 @@
     private Menu firstMenu = new Menu(firstMenuMap);
     private Menu secondMenu = new Menu(secondMenuMap);
 
-    private URL url = URL.valueOf(new StringBuilder(32)
-            .append("test://test/")
-            .append(MenuService.class.getName()).toString());
+    private URL url = URL.valueOf("test://test/" + 
MenuService.class.getName());
 
     static void merge(Map<String, List<String>> first, Map<String, 
List<String>> second) {
         for (Map.Entry<String, List<String>> entry : second.entrySet()) {
diff --git 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/beanutil/JavaBeanDescriptor.java
 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/beanutil/JavaBeanDescriptor.java
index ab6060663d..1bdeaabfdf 100644
--- 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/beanutil/JavaBeanDescriptor.java
+++ 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/beanutil/JavaBeanDescriptor.java
@@ -67,9 +67,7 @@ public JavaBeanDescriptor() {
     public JavaBeanDescriptor(String className, int type) {
         notEmpty(className, "class name is empty");
         if (!isValidType(type)) {
-            throw new IllegalArgumentException(
-                    new StringBuilder(16).append("type [ ")
-                            .append(type).append(" ] is 
unsupported").toString());
+            throw new IllegalArgumentException("type [ " + type + " ] is 
unsupported");
         }
 
         this.className = className;
diff --git 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ExecutorUtil.java 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ExecutorUtil.java
index eea7483819..d777c0f7fc 100644
--- 
a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ExecutorUtil.java
+++ 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ExecutorUtil.java
@@ -118,7 +118,7 @@ public void run() {
      */
     public static URL setThreadName(URL url, String defaultName) {
         String name = url.getParameter(Constants.THREAD_NAME_KEY, defaultName);
-        name = new 
StringBuilder(32).append(name).append("-").append(url.getAddress()).toString();
+        name = name + "-" + url.getAddress();
         url = url.addParameter(Constants.THREAD_NAME_KEY, name);
         return url;
     }
diff --git 
a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeartbeatHandler.java
 
b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeartbeatHandler.java
index ae88f8c386..7cdffb5ac2 100644
--- 
a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeartbeatHandler.java
+++ 
b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeartbeatHandler.java
@@ -77,11 +77,7 @@ public void received(Channel channel, Object message) throws 
RemotingException {
         }
         if (isHeartbeatResponse(message)) {
             if (logger.isDebugEnabled()) {
-                logger.debug(
-                        new StringBuilder(32)
-                                .append("Receive heartbeat response in thread 
")
-                                .append(Thread.currentThread().getName())
-                                .toString());
+                logger.debug("Receive heartbeat response in thread " + 
Thread.currentThread().getName());
             }
             return;
         }
diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericFilter.java
 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericFilter.java
index 231d74dfe5..f5df8defd7 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericFilter.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericFilter.java
@@ -78,12 +78,12 @@ public Result invoke(Invoker<?> invoker, Invocation inv) 
throws RpcException {
                             }
                         } else {
                             throw new RpcException(
-                                    new StringBuilder(32).append("Generic 
serialization [")
-                                            
.append(Constants.GENERIC_SERIALIZATION_NATIVE_JAVA)
-                                            .append("] only support message 
type ")
-                                            .append(byte[].class)
-                                            .append(" and your message type is 
")
-                                            
.append(args[i].getClass()).toString());
+                                    "Generic serialization [" +
+                                            
Constants.GENERIC_SERIALIZATION_NATIVE_JAVA +
+                                            "] only support message type " +
+                                            byte[].class +
+                                            " and your message type is " +
+                                            args[i].getClass());
                         }
                     }
                 } else if (ProtocolUtils.isBeanGenericSerialization(generic)) {
@@ -92,13 +92,12 @@ public Result invoke(Invoker<?> invoker, Invocation inv) 
throws RpcException {
                             args[i] = 
JavaBeanSerializeUtil.deserialize((JavaBeanDescriptor) args[i]);
                         } else {
                             throw new RpcException(
-                                    new StringBuilder(32)
-                                            .append("Generic serialization [")
-                                            
.append(Constants.GENERIC_SERIALIZATION_BEAN)
-                                            .append("] only support message 
type ")
-                                            
.append(JavaBeanDescriptor.class.getName())
-                                            .append(" and your message type is 
")
-                                            
.append(args[i].getClass().getName()).toString());
+                                    "Generic serialization [" +
+                                            
Constants.GENERIC_SERIALIZATION_BEAN +
+                                            "] only support message type " +
+                                            JavaBeanDescriptor.class.getName() 
+
+                                            " and your message type is " +
+                                            args[i].getClass().getName());
                         }
                     }
                 }
diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericImplFilter.java
 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericImplFilter.java
index f79baa1071..307c755984 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericImplFilter.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/GenericImplFilter.java
@@ -90,13 +90,12 @@ public Result invoke(Invoker<?> invoker, Invocation 
invocation) throws RpcExcept
                             return new 
RpcResult(JavaBeanSerializeUtil.deserialize((JavaBeanDescriptor) value));
                         } else {
                             throw new RpcException(
-                                    new StringBuilder(64)
-                                            .append("The type of result value 
is ")
-                                            .append(value.getClass().getName())
-                                            .append(" other than ")
-                                            
.append(JavaBeanDescriptor.class.getName())
-                                            .append(", and the result is ")
-                                            .append(value).toString());
+                                    "The type of result value is " +
+                                            value.getClass().getName() +
+                                            " other than " +
+                                            JavaBeanDescriptor.class.getName() 
+
+                                            ", and the result is " +
+                                            value);
                         }
                     } else {
                         return new RpcResult(PojoUtils.realize(value, 
method.getReturnType(), method.getGenericReturnType()));
@@ -174,13 +173,12 @@ public Result invoke(Invoker<?> invoker, Invocation 
invocation) throws RpcExcept
 
     private void error(String expected, String actual) throws RpcException {
         throw new RpcException(
-                new StringBuilder(32)
-                        .append("Generic serialization [")
-                        .append(Constants.GENERIC_SERIALIZATION_NATIVE_JAVA)
-                        .append("] only support message type ")
-                        .append(expected)
-                        .append(" and your message type is ")
-                        .append(actual).toString());
+                "Generic serialization [" +
+                        Constants.GENERIC_SERIALIZATION_NATIVE_JAVA +
+                        "] only support message type " +
+                        expected +
+                        " and your message type is " +
+                        actual);
     }
 
 }
\ No newline at end of file
diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/TpsLimitFilter.java
 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/TpsLimitFilter.java
index 0b5eafccee..dc710efb3a 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/TpsLimitFilter.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/TpsLimitFilter.java
@@ -39,13 +39,11 @@ public Result invoke(Invoker<?> invoker, Invocation 
invocation) throws RpcExcept
 
         if (!tpsLimiter.isAllowable(invoker.getUrl(), invocation)) {
             throw new RpcException(
-                    new StringBuilder(64)
-                            .append("Failed to invoke service ")
-                            .append(invoker.getInterface().getName())
-                            .append(".")
-                            .append(invocation.getMethodName())
-                            .append(" because exceed max service tps.")
-                            .toString());
+                    "Failed to invoke service " +
+                            invoker.getInterface().getName() +
+                            "." +
+                            invocation.getMethodName() +
+                            " because exceed max service tps.");
         }
 
         return invoker.invoke(invocation);
diff --git 
a/dubbo-rpc/dubbo-rpc-rest/src/main/java/com/alibaba/dubbo/rpc/protocol/rest/RpcContextFilter.java
 
b/dubbo-rpc/dubbo-rpc-rest/src/main/java/com/alibaba/dubbo/rpc/protocol/rest/RpcContextFilter.java
index f250425dec..644fe92794 100644
--- 
a/dubbo-rpc/dubbo-rpc-rest/src/main/java/com/alibaba/dubbo/rpc/protocol/rest/RpcContextFilter.java
+++ 
b/dubbo-rpc/dubbo-rpc-rest/src/main/java/com/alibaba/dubbo/rpc/protocol/rest/RpcContextFilter.java
@@ -79,11 +79,8 @@ public void filter(ClientRequestContext requestContext) 
throws IOException {
                 throw new IllegalArgumentException("The attachments of " + 
RpcContext.class.getSimpleName() + " is too big");
             }
 
-            StringBuilder attachments = new StringBuilder();
-            attachments.append(entry.getKey());
-            attachments.append("=");
-            attachments.append(entry.getValue());
-            requestContext.getHeaders().add(DUBBO_ATTACHMENT_HEADER, 
attachments.toString());
+            String attachments = entry.getKey() + "=" + entry.getValue();
+            requestContext.getHeaders().add(DUBBO_ATTACHMENT_HEADER, 
attachments);
         }
     }
 }
diff --git 
a/dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ThriftCodec.java
 
b/dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ThriftCodec.java
index ced6439520..873a5c2092 100644
--- 
a/dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ThriftCodec.java
+++ 
b/dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ThriftCodec.java
@@ -104,13 +104,8 @@ public void encode(Channel channel, ChannelBuffer buffer, 
Object message)
         } else if (message instanceof Response) {
             encodeResponse(channel, buffer, (Response) message);
         } else {
-            throw new UnsupportedOperationException(
-                    new StringBuilder(32)
-                            .append("Thrift codec only support encode ")
-                            .append(Request.class.getName())
-                            .append(" and ")
-                            .append(Response.class.getName())
-                            .toString());
+            throw new UnsupportedOperationException("Thrift codec only support 
encode " 
+                    + Request.class.getName() + " and " + 
Response.class.getName());
         }
 
     }
@@ -144,11 +139,7 @@ public Object decode(Channel channel, ChannelBuffer 
buffer) throws IOException {
             }
 
             if (MAGIC != magic) {
-                throw new IOException(
-                        new StringBuilder(32)
-                                .append("Unknown magic code ")
-                                .append(magic)
-                                .toString());
+                throw new IOException("Unknown magic code " + magic);
             }
 
             if (available < messageLength) {
@@ -303,12 +294,8 @@ private Object decode(TProtocol protocol)
                     
.getExtension(ThriftClassNameGenerator.NAME).generateResultClassName(serviceName,
 message.name);
 
             if (StringUtils.isEmpty(resultClassName)) {
-                throw new IllegalArgumentException(
-                        new StringBuilder(32)
-                                .append("Could not infer service result class 
name from service name ")
-                                .append(serviceName)
-                                .append(", the service name you specified may 
not generated by thrift idl compiler")
-                                .toString());
+                throw new IllegalArgumentException("Could not infer service 
result class name from service name " 
+                        + serviceName + ", the service name you specified may 
not generated by thrift idl compiler");
             }
 
             Class<?> clazz = cachedClass.get(resultClassName);
@@ -409,11 +396,8 @@ private void encodeRequest(Channel channel, ChannelBuffer 
buffer, Request reques
         String serviceName = inv.getAttachment(Constants.INTERFACE_KEY);
 
         if (StringUtils.isEmpty(serviceName)) {
-            throw new IllegalArgumentException(
-                    new StringBuilder(32)
-                            .append("Could not find service name in attachment 
with key ")
-                            .append(Constants.INTERFACE_KEY)
-                            .toString());
+            throw new IllegalArgumentException("Could not find service name in 
attachment with key " 
+                    + Constants.INTERFACE_KEY);
         }
 
         TMessage message = new TMessage(
@@ -427,8 +411,7 @@ private void encodeRequest(Channel channel, ChannelBuffer 
buffer, Request reques
 
         if (StringUtils.isEmpty(methodArgs)) {
             throw new RpcException(RpcException.SERIALIZATION_EXCEPTION,
-                    new StringBuilder(32).append(
-                            "Could not encode request, the specified interface 
may be incorrect.").toString());
+                    "Could not encode request, the specified interface may be 
incorrect.");
         }
 
         Class<?> clazz = cachedClass.get(methodArgs);
@@ -553,8 +536,7 @@ private void encodeResponse(Channel channel, ChannelBuffer 
buffer, Response resp
 
         if (StringUtils.isEmpty(resultClassName)) {
             throw new RpcException(RpcException.SERIALIZATION_EXCEPTION,
-                    new StringBuilder(32).append(
-                            "Could not encode response, the specified 
interface may be incorrect.").toString());
+                    "Could not encode response, the specified interface may be 
incorrect.");
         }
 
         Class clazz = cachedClass.get(resultClassName);
diff --git 
a/dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ext/MultiServiceProcessor.java
 
b/dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ext/MultiServiceProcessor.java
index 5877d9c3db..72075aa207 100644
--- 
a/dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ext/MultiServiceProcessor.java
+++ 
b/dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ext/MultiServiceProcessor.java
@@ -47,10 +47,7 @@ public boolean process(TProtocol in, TProtocol out) throws 
TException {
         short magic = in.readI16();
 
         if (magic != ThriftCodec.MAGIC) {
-            logger.error(
-                    new StringBuilder(24)
-                            .append("Unsupported magic ")
-                            .append(magic).toString());
+            logger.error("Unsupported magic " + magic);
             return false;
         }
 
@@ -69,11 +66,7 @@ public boolean process(TProtocol in, TProtocol out) throws 
TException {
         TProcessor processor = processorMap.get(serviceName);
 
         if (processor == null) {
-            logger.error(
-                    new StringBuilder(32)
-                            .append("Could not find processor for service ")
-                            .append(serviceName)
-                            .toString());
+            logger.error("Could not find processor for service " + 
serviceName);
             return false;
         }
 
diff --git 
a/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/HeartbeatClient.java
 
b/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/HeartbeatClient.java
index 9a03b11abc..dd6b4449f1 100644
--- 
a/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/HeartbeatClient.java
+++ 
b/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/HeartbeatClient.java
@@ -29,11 +29,7 @@
 
 public class HeartbeatClient {
 
-    private static final URL serverUrl = URL.valueOf(
-            new StringBuilder(32)
-                    .append("netty://")
-                    .append(NetUtils.getLocalHost())
-                    .append(":9999").toString())
+    private static final URL serverUrl = URL.valueOf("netty://" + 
NetUtils.getLocalHost() + ":9999")
             .addParameter(Constants.CODEC_KEY, "exchange");
 
     private static final ExchangeHandler handler = new 
ExchangeHandlerAdapter() {
diff --git 
a/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/HeartbeatServer.java
 
b/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/HeartbeatServer.java
index 611c15d2f0..2bf8917ba8 100644
--- 
a/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/HeartbeatServer.java
+++ 
b/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/HeartbeatServer.java
@@ -29,11 +29,7 @@
 
 public class HeartbeatServer {
 
-    private static final URL clientUrl = URL.valueOf(
-            new StringBuilder(32)
-                    .append("netty://")
-                    .append(NetUtils.getLocalHost())
-                    .append(":9999").toString())
+    private static final URL clientUrl = URL.valueOf("netty://" + 
NetUtils.getLocalHost() + ":9999")
             .addParameter(Constants.CODEC_KEY, "exchange");
 
     private static final ExchangeHandler handler = new 
ExchangeHandlerAdapter() {
diff --git 
a/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/impl/HelloServiceImpl.java
 
b/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/impl/HelloServiceImpl.java
index a49e63f3af..c3f98c2401 100644
--- 
a/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/impl/HelloServiceImpl.java
+++ 
b/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/heartbeat/impl/HelloServiceImpl.java
@@ -21,6 +21,6 @@
 public class HelloServiceImpl implements HelloService {
 
     public String sayHello(String name) {
-        return new StringBuilder(32).append("Hello, 
").append(name).append("!").toString();
+        return "Hello, " + name + "!";
     }
 }


 

----------------------------------------------------------------
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