mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
StreamToLoopInspection: added ExplicitCollectTerminalOperation; StreamVariable simplified; guard checks added (IDEA-CR-15249)
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Main {
|
||||
private static void test(List<String> list) {
|
||||
long count1 = 0;
|
||||
for (String s : list) {
|
||||
if (!s.isEmpty()) {
|
||||
count1++;
|
||||
}
|
||||
}
|
||||
long count = count1;
|
||||
if(count > 10) {
|
||||
long result = count*2;
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user