StreamToLoop: disable in this()/super() constructor invocation as we cannot generate statements before this/super call.

This commit is contained in:
Tagir Valeev
2016-12-12 19:10:19 +07:00
parent 787de0aeda
commit f25764d72f
4 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
// "Replace Stream API chain with loop" "false"
import java.util.stream.Stream;
import java.util.Objects;
public class Main {
Main(boolean b) {}
static class Child extends Main {
// cannot replace as replacement would generate a statement before "super" call
Child() {
super(Stream.of("a", "b", "c").an<caret>yMatch(Objects::nonNull));
}
}
}