index rhs java.lang.ArrayIndexOutOfBoundsException