I am quite convinced that here
final int i; try { i = calculateIndex(); } catch (Exception e) { i = 1; }
i cannot possibly have
i
But i may be assigned twice
int i; try { i = calculateIndex(); // suppose func returns true System.out.println("i=" + i); throw new IOException(); } catch (IOException e) { i = 1; System.out.println("i=" + i); }
output
i=0 i=1
and it means it cannot be final