IDEA-161259 follow-up: support scenarios when iterator.next() call is inlined into condition

This commit is contained in:
Tagir Valeev
2016-10-05 15:24:55 +07:00
parent 9a8480fba1
commit afd1d1b470
5 changed files with 148 additions and 20 deletions
@@ -0,0 +1,13 @@
// "Replace the loop with Collection.removeIf" "true"
import java.util.Iterator;
import java.util.List;
public class Main {
public void testIterator(List<List<String>> data, boolean b) {
for(Ite<caret>rator<List<String>> iter = data.iterator(); iter.hasNext();) {
if(iter.next().isEmpty() && b) {
iter.remove();
}
}
}
}