Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamToLoop/afterReusedVar.java
Tagir Valeev 7e1064ea3c [java-intentions] More preview tests; minor fixes
GitOrigin-RevId: 22a46c15d8900d8a31514846755a013f6a67ad42
2022-07-29 17:55:13 +00:00

22 lines
514 B
Java

// "Replace Stream API chain with loop" "true-preview"
import java.util.List;
import java.util.function.LongSupplier;
public class Main {
private static void test(List<String> list) {
// and filter!
long count1 = 0L;
for (String s : list) {
if (!s/* comment */.isEmpty()) {
count1++;
}
}
long count = count1;
if(count > 10) {
LongSupplier sup = () -> count*2;
long result = sup.get();
System.out.println(result);
}
}
}