ChristopherSchultz commented on code in PR #523:
URL: https://github.com/apache/tomcat/pull/523#discussion_r895047173


##########
java/org/apache/el/parser/AstMethodParameters.java:
##########
@@ -39,15 +40,12 @@ public Object[] getParameters(EvaluationContext ctx) {
     public String toString() {
         // Purely for debug purposes. May not be complete or correct. Certainly
         // is not efficient. Be sure not to call this from 'real' code.
-        StringBuilder result = new StringBuilder();
-        result.append('(');
+        StringJoiner result = new StringJoiner(",","(",")");
         if (children != null) {
             for (Node n : children) {
-                result.append(n.toString());
-                result.append(',');
+                result.add(n.toString());

Review Comment:
   I'm not sure how much it matters, but the old implementation would have 
ended up with a trailing `,` after the final element, where the new 
implementation doesn't. Perhaps that's preferable; I didn't check out the 
use-case for the code.



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

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to