-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Jackson 3] Fix #3580 Enum (de)serialization in conjunction with JsonFormat.Shape.NUMBER_INT
#5338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@JooHyukKim This seems incomplete? Or maybe diff is missing something due to conflict? |
|
@cowtowncoder Yes, there were some other commits on same file, affecting this PR. THankss |
|
Ready for review! Just in case I wasn't clear enough |
src/main/java/tools/jackson/databind/deser/jdk/EnumDeserializer.java
Outdated
Show resolved
Hide resolved
src/main/java/tools/jackson/databind/deser/jdk/EnumDeserializer.java
Outdated
Show resolved
Hide resolved
| */ | ||
| protected final boolean _isShapeNumberInt; | ||
|
|
||
| public EnumDeserializer(EnumResolver byNameResolver, boolean caseInsensitive, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to start deprecating methods, adding overloads (since it's 3.1, not 3.0)
src/main/java/tools/jackson/databind/deser/BasicDeserializerFactory.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| for (int i = enumConstants.length; --i >= 0; ) { // from last to first, so that in case of duplicate values, first wins | ||
| Enum<?> en = enumConstants[i]; | ||
| try { | ||
| Object o = accessor.getValue(en); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is being accessed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value returned from method annotated with @JsonValue.
What could be a good improvement here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmh. Maybe explain calling @JsonValue annotated accessor (Field/Method) on every enum entry?
|
Thank you for the review @cowtowncoder ! |
|
I re-examined paths before adding more JavaDoc, it just works without any additional implementation 🤔. |
|
Closing in favor of #5376 |
No description provided.