public class InlineNullInForEach { int[] data() { return null; } void test() { for (int i : data()) { System.out.println(i); } } }