File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ private static List<Status> buildStatusList() {
307
307
* Return a {@link Status} given a canonical error {@link Code} value.
308
308
*/
309
309
public static Status fromCodeValue (int codeValue ) {
310
- if (codeValue < 0 || codeValue > STATUS_LIST .size ()) {
310
+ if (codeValue < 0 || codeValue >= STATUS_LIST .size ()) {
311
311
return UNKNOWN .withDescription ("Unknown code " + codeValue );
312
312
} else {
313
313
return STATUS_LIST .get (codeValue );
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ public void verifyExceptionMessage() {
43
43
@ Test
44
44
public void impossibleCodeValue () {
45
45
assertEquals (Code .UNKNOWN , Status .fromCodeValue (-1 ).getCode ());
46
+ assertEquals (Code .UNKNOWN , Status .fromCodeValue (17 ).getCode ());
46
47
}
47
48
48
49
@ Test
You can’t perform that action at this time.
0 commit comments