You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// But let's consider int acceptable as well (if within ordinal range)
77
77
if (curr == JsonToken.VALUE_NUMBER_INT) {
78
78
// ... unless told not to do that. :-) (as per [JACKSON-412]
79
-
if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS)) {
80
-
throwctxt.mappingException("Not allowed to deserialize Enum value out of JSON number (disable DeserializationConfig.DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS to allow)");
81
-
}
79
+
_checkFailOnNumber(ctxt);
82
80
83
81
intindex = jp.getIntValue();
84
82
Enum<?> result = _resolver.getEnum(index);
@@ -105,6 +103,7 @@ private final Enum<?> _deserializeAltString(JsonParser jp, DeserializationContex
105
103
if (c >= '0' && c <= '9') {
106
104
try {
107
105
intix = Integer.parseInt(name);
106
+
_checkFailOnNumber(ctxt);
108
107
Enum<?> result = _resolver.getEnum(ix);
109
108
if (result != null) {
110
109
returnresult;
@@ -121,7 +120,7 @@ private final Enum<?> _deserializeAltString(JsonParser jp, DeserializationContex
if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS)) {
143
+
throwctxt.mappingException("Not allowed to deserialize Enum value out of JSON number (disable DeserializationConfig.DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS to allow)");
0 commit comments