Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It uses an ArrayIndexOutOfBoundsException to detect the end of the array and reinitialize the value of variable i to 0 in the catch block. However, when some element of the array is null, a NullPointerException results. This exception is caught and ignored, a violation of guideline EXC15ERR15-J. Do not catch NullPointerException. Consequently, the variable i fails to be reinitialized.

...