Merge pull request #7853 from belugabehr/CopyList
Use ArrayList copy constructor
This commit is contained in:
commit
21873ae54a
@ -1081,8 +1081,7 @@ final class FieldSet<T extends FieldSet.FieldDescriptorLite<T>> {
|
||||
|
||||
// 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, element);
|
||||
hasNestedBuilders = hasNestedBuilders || element instanceof MessageLite.Builder;
|
||||
|
Loading…
Reference in New Issue
Block a user