-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support suppressed
property when deserializing Throwable
#3179
Conversation
…serialization of Throwable.getCause()
Supporting the suppressed property when deserializing Throwable
Sounds good. I will be out of town over the weekend, but will get back to this next week. One thing I'd need (unless it's already done) to eventually merge the PR is CLA: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf which only needs to be sent once and is good for all Jackson contributions. |
// Maybe it's "suppressed"? | ||
final boolean isSuppressed = PROP_NAME_SUPPRESSED.equals(propName); | ||
if (isSuppressed) { | ||
suppressed = p.readValueAs(Throwable[].class); |
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.
Instead of calling via JsonParser
, should go through DeserializationContext
; this will keep current context and settings (JsonParser
route will create new context with possibly differing settings -- at least until Jackson 3.0)
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.
OK, changed the corresponding line to
suppressed = ctxt.readValue(p, Throwable[].class);
@klaasdellschaft Aside from one minor comment, looks good (assuming it works). Are changes needed? |
Addressing review comment. Small refactoring in order to reduce code duplication.
CLA is sent, and a small refactoring is applied such that duplicated code blocks are removed. From my point of view, ready for merging. |
suppressed
property when deserializing Throwable
Closes #3177
When this solution for #3177 is OK, I would suggest to continue refactoring
ThrowableDeserializer.deserializeFromObject(...)
such that code duplications are removed / the method gets shorter. For example, the following snippet exists twice in the method