Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/java9/afterIteratePredicateJava9.java
Tagir Valeev bcb843dd8f [java-inspections] LambdaCanBeMethodReference: disable conversion in many cases when cast is required
Fixes IDEA-267865 Add a option for Java's method reference inspection that ignore lambda which can't convert into method reference without a cast

GitOrigin-RevId: b6f762383d6ba1ef19a5de36e0ad53d107ba4e80
2021-10-09 13:28:51 +00:00

16 lines
322 B
Java

// "Replace with forEach" "true"
import java.util.stream.Stream;
public class Main {
static class A {
A next(){return null;}
int x;
}
static boolean isGood(A a) {}
public long test() {
Stream.iterate(new A(), a -> isGood(a), a -> a.next()).filter(a -> a.x < 3).forEach(System.out::println);
}
}