diff -U 5 -r defects4j/Lang-20/buggy/src/main/java/org/apache/commons/lang3/StringUtils.java defects4j/Lang-20/fixed/src/main/java/org/apache/commons/lang3/StringUtils.java --- defects4j/Lang-20/buggy/src/main/java/org/apache/commons/lang3/StringUtils.java 2024-04-14 01:08:54.000000000 +0900 +++ defects4j/Lang-20/fixed/src/main/java/org/apache/commons/lang3/StringUtils.java 2024-04-14 01:09:03.000000000 +0900 @@ -3293,11 +3293,11 @@ int noOfItems = (endIndex - startIndex); if (noOfItems <= 0) { return EMPTY; } - StringBuilder buf = new StringBuilder((array[startIndex] == null ? 16 : array[startIndex].toString().length()) + 1); + StringBuilder buf = new StringBuilder(noOfItems * 16); for (int i = startIndex; i < endIndex; i++) { if (i > startIndex) { buf.append(separator); } @@ -3378,11 +3378,11 @@ int noOfItems = (endIndex - startIndex); if (noOfItems <= 0) { return EMPTY; } - StringBuilder buf = new StringBuilder((array[startIndex] == null ? 16 : array[startIndex].toString().length()) + separator.length()); + StringBuilder buf = new StringBuilder(noOfItems * 16); for (int i = startIndex; i < endIndex; i++) { if (i > startIndex) { buf.append(separator); }