-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Issue#233 XmlMapper.copy() doesn't properly copy internal configurations #234
Conversation
@@ -56,6 +55,11 @@ public XmlSerializerProvider(XmlSerializerProvider src, | |||
*/ | |||
|
|||
@Override | |||
public DefaultSerializerProvider copy() { | |||
return this; |
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.
I can add a comment if needed, but I'm doing this because XmlSerializerProvider
is effectively immutable in that its only member variable is also immutable, and so I can avoid having to try to figure out whether I should construct it with just an instance of XmlRootNameLookup
or with an instance of itself and SerializationConfig
and SerializerFactory
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.
A brief comment would be appreciated... however, are you sure this is safe? Keep in mind that it extends DefaultSerializerProvider
so I think it would be better to create a copy (super-class single-arg constructor to use).
import javax.xml.stream.XMLStreamWriter; | ||
|
||
import com.fasterxml.jackson.core.*; | ||
import com.fasterxml.jackson.core.PrettyPrinter; |
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.
Please do not reformat code in places where you don't change it.
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.
Sorry about that, IntelliJ auto-formatted it, I'll revert those
Excellent, thank you! Will merge. |
Resolves issue #233