Github user otaviojava commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/919#discussion_r211940698
--- Diff:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
---
@@ -286,10 +286,10 @@ private void appendMetrics(final Collection<? extends
Metrics> metrics, final St
private static String padLeft(final String text, final int
amountToPad) {
// not sure why this method needed to exist. stupid string format
stuff and commons utilities wouldn't
// work for some reason in the context this method was used above.
- String newText = text;
+ final StringBuilder newText = new StringBuilder(text);
for (int ix = 0; ix < amountToPad; ix++) {
- newText = " " + newText;
+ newText.insert(0, " ");
}
--- End diff --
That is the same previous behavior, but using StringBuilder this time.
https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html#insert-int-java.lang.String-
---