StreamToLoopInspection: handle labeled expression statement (found by property testing)

This commit is contained in:
Tagir Valeev
2018-07-27 13:05:24 +07:00
parent 139f4e8ed0
commit a6643bdab2
3 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
import java.util.Arrays;
import java.util.stream.Stream;
public class Main {
void test() {
for (String s : Arrays.asList("foo", "bar", "baz")) {
System.out.println(s);
}
String s = "xyz";
System.out.println(s);
}
}

View File

@@ -0,0 +1,13 @@
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
import java.util.stream.Stream;
public class Main {
void test() {
test:
Stream<caret>.of("foo", "bar", "baz").forEach(System.out::println);
String s = "xyz";
System.out.println(s);
}
}