[GitHub] beiwei30 commented on a change in pull request #1388: Remove unnecessary StringBuilder

2018-04-07 Thread GitBox
beiwei30 commented on a change in pull request #1388: Remove unnecessary 
StringBuilder
URL: https://github.com/apache/incubator-dubbo/pull/1388#discussion_r179933003
 
 

 ##
 File path: 
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");
 
 Review comment:
   agree. I will accept the change, but will submit a supplementary change 
because it's safer by doing this.


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


[GitHub] beiwei30 commented on a change in pull request #1388: Remove unnecessary StringBuilder

2018-04-04 Thread GitBox
beiwei30 commented on a change in pull request #1388: Remove unnecessary 
StringBuilder
URL: https://github.com/apache/incubator-dubbo/pull/1388#discussion_r179045903
 
 

 ##
 File path: 
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");
 
 Review comment:
   this is incorrect, it should be
   
   ```java
   throw new IllegalArgumentException((i + 1) + "th argument is not an array");
   ```


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