mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-27 22:20:54 +07:00
15 lines
349 B
Java
15 lines
349 B
Java
// "Replace iteration with bulk 'Collection.addAll()' call" "true-preview"
|
|
import java.util.*;
|
|
|
|
public class Collect {
|
|
class Person {}
|
|
|
|
void collectNames(List<Person> persons){
|
|
List<Person> names = new ArrayList<>();
|
|
for(int i = 0; i<persons.size(); i = i + 1) {
|
|
Person p = persons.get(i);
|
|
(names).<caret>add(p);
|
|
}
|
|
}
|
|
}
|