Files
openide/java/java-tests/testData/inspection/explicitArrayFilling/afterTernaryWithMutable.java
Artemiy Sartakov e728e7eda8 ExplicitArrayFillingInspection: suggest Arrays.fill in cases when filled value is immutable (IDEA-CR-50510)
GitOrigin-RevId: a9d5627d25572edeb2f920aff62d108dd6f183ac
2019-07-26 11:02:46 +03:00

12 lines
236 B
Java

// "Replace loop with 'Arrays.setAll()' method call" "true"
import java.util.Arrays;
class Test {
void test(boolean choice) {
Object[] arr = new Object[10];
Arrays.setAll(arr, i -> (choice ? "foo" : new Object()));
}
}