Skip to content

Commit 0aa6486

Browse files
committed
Update release notes for #1332, backport in 2.7.7
1 parent 2936ba5 commit 0aa6486

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

release-notes/CREDITS

+4
Original file line numberDiff line numberDiff line change
@@ -467,3 +467,7 @@ Erich Schubert (kno10@github)
467467
Brian Pontarelli (voidmain@github)
468468
* Reported #1301: Problem with `JavaType.toString()` for recursive (self-referential) types
469469
(2.7.6)
470+
471+
Max Drobotov (fizmax@github)
472+
* Reported, contributed fix for #1332: `ArrayIndexOutOfBoundException` for enum by index deser
473+
(2.7.7)

release-notes/VERSION

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Project: jackson-databind
88

99
#1322: EnumMap keys not using enum's `@JsonProperty` values unlike Enum values
1010
(reported by MichaelChambers@github)
11+
#1332: Fixed ArrayIndexOutOfBoundException for enum by index deser
12+
(reported by Max D)
1113

1214
2.7.6 (23-Jul-2016)
1315

src/main/java/com/fasterxml/jackson/databind/deser/std/EnumDeserializer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
104104
if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS)) {
105105
_failOnNumber(ctxt, p, index);
106106
}
107-
if (index >= 0 && index <= _enumsByIndex.length) {
107+
if (index >= 0 && index < _enumsByIndex.length) {
108108
return _enumsByIndex[index];
109109
}
110110
if (!ctxt.isEnabled(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL)) {
@@ -139,7 +139,7 @@ private final Object _deserializeAltString(JsonParser p, DeserializationContext
139139
if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS)) {
140140
_failOnNumber(ctxt, p, ix);
141141
}
142-
if (ix >= 0 && ix <= _enumsByIndex.length) {
142+
if (ix >= 0 && ix < _enumsByIndex.length) {
143143
return _enumsByIndex[ix];
144144
}
145145
} catch (NumberFormatException e) {

0 commit comments

Comments
 (0)