This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit 74a9bea58feb0a15b906623dff06721b07fec6a7 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun May 12 18:13:45 2024 -0400 Better implementation of org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle.spacer(int) --- .../commons/lang3/builder/MultilineRecursiveToStringStyle.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java index 861a55fe2..54cb160c7 100644 --- a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java +++ b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java @@ -18,6 +18,7 @@ package org.apache.commons.lang3.builder; import org.apache.commons.lang3.ClassUtils; +import org.apache.commons.lang3.StringUtils; /** * Works with {@link ToStringBuilder} to create a "deep" {@code toString}. @@ -206,12 +207,8 @@ public class MultilineRecursiveToStringStyle extends RecursiveToStringStyle { * @param spaces how far to indent * @return a StringBuilder with {spaces} leading space characters. */ - private StringBuilder spacer(final int spaces) { - final StringBuilder sb = new StringBuilder(); - for (int i = 0; i < spaces; i++) { - sb.append(" "); - } - return sb; + private String spacer(final int spaces) { + return StringUtils.repeat(' ', spaces); } }