Files
openide/java/java-tests/testData/inspection/java8CollectionRemoveIf/beforeForEachRemoveSimple.java
Tagir Valeev dea2294709 Java8CollectionRemoveIf: support for-each loop (IDEA-214448)
GitOrigin-RevId: 4ac219e418cc0bef8e1930d14d53256e3c87be6e
2019-07-02 06:52:16 +03:00

11 lines
316 B
Java

// "Replace the loop with Collection.removeIf" "true"
import java.util.*;
public class Main {
public void removeEmpty(List<String> list) throws Exception {
for(<caret>String item : list) {
// Presumably CopyOnWriteArrayList
if(item.isEmpty()) list.remove(item);
}
}
}