void (String[] arr) { boolean flag = false; for (int i = 0; i < arr.length; i++) { <warning descr="Loop can be terminated after condition is met">if</warning> (arr[i] == null) { flag = true; } } for (String s : arr) { <warning descr="Loop can be terminated after condition is met">if</warning> (s == null) { flag = true; } } int i = 0; while (i < arr.length) { <warning descr="Loop can be terminated after condition is met">if</warning> (arr[i] == null) { flag = true; } i++; } i = 0; do { <warning descr="Loop can be terminated after condition is met">if</warning> (arr[i] == null) { flag = true; } i++; } while (i != arr.length); }