mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
ControlFlowUtils#statementBreaksLoop: fix void return case
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with findFirst()" "true"
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class TestFile {
|
||||
public void test() {
|
||||
Stream.of("a", "b").filter(s -> !s.isEmpty()).findFirst().ifPresent(System.out::println);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with findFirst()" "true"
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class TestFile {
|
||||
public void test() {
|
||||
for(String s : Ar<caret>rays.asList("a", "b")) {
|
||||
if(!s.isEmpty()) {
|
||||
System.out.println(s);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user