Files
openide/java/java-tests/testData/inspection/java8CollectionRemoveIf/beforeForEachRemoveSimple.java
Andrey.Cherkasov 205cf1eb2b [java-inspections] Java8CollectionRemoveIf: highlight only 'for'/'while' keyword instead of the whole statement
GitOrigin-RevId: b2b312efab7a974dab6a2021a788274bc6cfc1b2
2022-01-12 15:15:06 +00:00

11 lines
318 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);
}
}
}