diff --git a/java/core/src/main/java/com/google/protobuf/FieldSet.java b/java/core/src/main/java/com/google/protobuf/FieldSet.java index d52aede95803..8306c471cca7 100644 --- a/java/core/src/main/java/com/google/protobuf/FieldSet.java +++ b/java/core/src/main/java/com/google/protobuf/FieldSet.java @@ -1078,8 +1078,7 @@ public void setField(final T descriptor, Object value) { // Wrap the contents in a new list so that the caller cannot change // the list's contents after setting it. - final List newList = new ArrayList(); - newList.addAll((List) value); + final List newList = new ArrayList((List) value); for (final Object element : newList) { verifyType(descriptor.getLiteType(), element); hasNestedBuilders = hasNestedBuilders || element instanceof MessageLite.Builder;