Skip to content
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

Merged
merged 2 commits into from
May 18, 2017

Conversation

gtrog
Copy link
Contributor

@gtrog gtrog commented May 16, 2017

Resolves issue #233

@@ -56,6 +55,11 @@ public XmlSerializerProvider(XmlSerializerProvider src,
*/

@Override
public DefaultSerializerProvider copy() {
return this;
Copy link
Contributor Author

@gtrog gtrog May 16, 2017

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

Copy link
Member

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;
Copy link
Member

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.

Copy link
Contributor Author

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

@cowtowncoder
Copy link
Member

Excellent, thank you! Will merge.

@cowtowncoder cowtowncoder merged commit c11cb6a into FasterXML:master May 18, 2017
@gtrog gtrog deleted the issue233 branch May 18, 2017 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants