mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Java8CollectionsApiInspection is split into 4 separate inspections
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace the loop with Collection.removeIf" "false"
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
public void removeEmpty(List<String> list) throws Exception {
|
||||
Iterator<String> it = list.iterator();
|
||||
while<caret>(it.hasNext()) {
|
||||
String str = it.next();
|
||||
// remove empty
|
||||
if(str.isEmpty()) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
it = list.iterator();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user