Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Management of the exception IndexOutOfBoundsException for Array variables #485

Closed
karimall72 opened this issue Jun 27, 2024 · 0 comments · Fixed by #490
Closed

Management of the exception IndexOutOfBoundsException for Array variables #485

karimall72 opened this issue Jun 27, 2024 · 0 comments · Fixed by #490

Comments

@karimall72
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants