Following expression will lead to a java.lang.IndexOutOfBoundsException:
EvaluationValue resultBadIndex = new Expression("MY_ARRAY[5]").with("MY_ARRAY", new int[] {1, 2}).evaluate();
According to me, it would be preferable to throw an EvalEx EvaluationException with the message related to the bad index (Index out of bound: Index 5 out of bounds for length 2)
Of course, the work around is easy (catch the IndexOutOfBoundsException), but I would consider my request as an improvement.
Following expression will lead to a java.lang.IndexOutOfBoundsException:
According to me, it would be preferable to throw an EvalEx
EvaluationException
with the message related to the bad index (Index out of bound: Index 5 out of bounds for length 2)Of course, the work around is easy (catch the
IndexOutOfBoundsException
), but I would consider my request as an improvement.