[OPENDJ-2299] ResultCode.valueOf throw java.lang.IndexOutOfBoundsException if the value is not in [0,16655[ Created: 23/Sep/15 Updated: 08/Nov/19 Resolved: 08/Oct/15
|Reporter:||Quentin CASTEL [X] (Inactive)||Assignee:||Matthew Swift|
The safe check is not correct
I like (0 <= intValue && intValue < ELEMENTS.length), I found it more readable
|Comment by Jean-Noël Rouvignac [ 23/Sep/15 ]|
Note: this is not a problem in opendj-sdk 3.0.0
Quentin CASTEL [X] I agree with your comment regarding how the condition should be written.
|Comment by Christophe Sovant [ 08/Oct/15 ]|
Verified using SDK 2.6.11 rev ee8adac5225770115e0106224b7911fe9c7f9ba9
I wrote a small test to use valueOf() with different values.
Here is the result before the fix:
==> we get the "ArrayIndexOutOfBoundsException" as described in the issue
Here is the result with the fix:
=> no more "ArrayIndexOutOfBoundsException"
|Comment by Mark Craig [ 08/Oct/15 ]|
Apply release-notes label