Skip to content

Commit efb15ea

Browse files
committed
Minor improvement to handling wrt #2823, less confusing exception message
1 parent 71d4d7d commit efb15ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
170170
JsonToken curr = p.currentToken();
171171

172172
// Usually should just get string value:
173-
if (curr == JsonToken.VALUE_STRING || curr == JsonToken.FIELD_NAME) {
173+
// 04-Sep-2020, tatu: for 2.11.3 / 2.12.0, removed "FIELD_NAME" as allowed;
174+
// did not work and gave odd error message.
175+
if (curr == JsonToken.VALUE_STRING) {
174176
CompactStringObjectMap lookup = ctxt.isEnabled(DeserializationFeature.READ_ENUMS_USING_TO_STRING)
175177
? _getToStringLookup(ctxt) : _lookupByName;
176178
final String name = p.getText();

0 commit comments

Comments
 (0)