void (String[] arr) { String foo = "foo"; String res = ""; for (String s : arr) { String three = "3"; <warning descr="Loop can be terminated after condition is met">if</warning> (s == null) { res = foo + three; } } foo = "bar"; }