mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Stream API migration: do not convert continue statements which belong to the nested loops (IDEA-204250)
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// "Replace with forEach" "true"
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
public class Test {
|
||||
void test(int[] arr, int[] arr2) {
|
||||
Arrays.stream(arr).forEach(x -> {
|
||||
int y = x * 2;
|
||||
if (x > y) return; // comment
|
||||
for (int i : arr2) {
|
||||
if (i % 2 == 0) continue;
|
||||
System.out.println(x);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with forEach" "true"
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class Test {
|
||||
void test(int[] arr, int[] arr2) {
|
||||
for<caret>(int x : arr) {
|
||||
int y = x*2;
|
||||
if(x > y) continue; // comment
|
||||
for(int i : arr2) {
|
||||
if (i % 2 == 0) continue;
|
||||
System.out.println(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user