mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
StreamToLoopInspection#ensureCodeBlock refactored to use PsiTreeUtil.mark/releaseMark (IDEA-CR-16755)
RefactoringUtil#expandExpressionLambdaToCodeBlock reverted (now changes there unnecessary) void single-expression lambda support
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Main {
|
||||
public void test(String... list) {
|
||||
Runnable s = () -> {
|
||||
for (String s1 : list) {
|
||||
if (Objects.nonNull(s1)) {
|
||||
System.out.println(s1);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Main().test("a", "bbb", null, "cc", "dd", "eedasfasdfs");
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Main {
|
||||
public void test(String... list) {
|
||||
Runnable s = () -> Stream.of(list)
|
||||
.filter(Objects::nonNull).for<caret>Each(System.out::println);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Main().test("a", "bbb", null, "cc", "dd", "eedasfasdfs");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user