mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-204917 "Loop can be collapsed with Stream API" creates uncompilable results in some cases
1. Look for references inside IntStream.iterate condition (Java9+) 2. When simplifying IntStream.range(...).map(i -> arr[i]) check if arr expression don't refer to i
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// "Replace with reduce()" "false"
|
||||
public class Foo {
|
||||
|
||||
boolean isAnyFalse(boolean[] array) {
|
||||
boolean status = true;
|
||||
|
||||
f<caret>or (int i = 0; i < array.length & status; i++) {
|
||||
status &= array[i];
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user