Files
openide/java/java-tests/testData/inspection/java8CollectionRemoveIf/beforeIteratorRemoveInlineShortCircuit.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

13 lines
355 B
Java

// "Replace the loop with 'Collection.removeIf'" "false"
import java.util.Iterator;
import java.util.List;
public class Main {
public void testIterator(List<List<String>> data, boolean b) {
for<caret>(Iterator<List<String>> iter = data.iterator(); iter.hasNext();) {
if(b && iter.next().isEmpty()) {
iter.remove();
}
}
}
}