private Object readByIndexToken(Object current,String indexToken){
  try {
    int index=Integer.parseInt(indexToken);
    JSONArray currentArr=(JSONArray)current;
    if (index >= currentArr.length()) {
      throw new JSONPointerException(format("index %d is out of bounds - the array has %d elements",index,currentArr.length()));
    }
    return currentArr.get(index);
  }
 catch (  NumberFormatException e) {
    throw new JSONPointerException(format("%s is not an array index",indexToken),e);
  }
}

private Object readByIndexToken ( Object current , String indexToken ) { try { int index = Integer . parseInt ( indexToken ) ; JSONArray currentArr = ( JSONArray ) current ; if ( index >= currentArr . length ( ) ) { throw new JSONPointerException ( format ( "index %d is out of bounds - the array has %d elements" , index , currentArr . length ( ) ) ) ; } return currentArr . get ( index ) ; } catch ( NumberFormatException e ) { throw new JSONPointerException ( format ( "%s is not an array index" , indexToken ) , e ) ; } }
matches a jsonarray element by ordinal position
