diff --git a/java/core/src/main/java/com/google/protobuf/Descriptors.java b/java/core/src/main/java/com/google/protobuf/Descriptors.java index fc9523676b..e22e66e6d2 100644 --- a/java/core/src/main/java/com/google/protobuf/Descriptors.java +++ b/java/core/src/main/java/com/google/protobuf/Descriptors.java @@ -415,11 +415,7 @@ public final class Descriptors { if (strings.length == 1) { return strings[0].getBytes(Internal.ISO_8859_1); } - StringBuilder descriptorData = new StringBuilder(); - for (String part : strings) { - descriptorData.append(part); - } - return descriptorData.toString().getBytes(Internal.ISO_8859_1); + return String.join("", strings).getBytes(Internal.ISO_8859_1); } private static FileDescriptor[] findDescriptors(