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

Removed prolog line feed in XMLPrettyPrinter as the current version m… #554

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,6 @@ public final void _handleEndObject() throws IOException
// note: since attributes don't nest, can only have one attribute active, so:
_nextIsAttribute = false;
_xmlWriter.writeEndElement();
// [databind-xml#172]: possibly also need indentation
if (_elementNameStack.isEmpty() && (_xmlPrettyPrinter != null)) {
// ... but only if it is likely to succeed:
if (!_stax2Emulation) {
_xmlPrettyPrinter.writePrologLinefeed(_xmlWriter);
}
}
} catch (XMLStreamException e) {
StaxUtil.throwAsGenerationException(e, this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void testSerializeAsText() throws IOException
assertEquals("<Simple a=\"13\">something</Simple>", xml);
// [dataformat-xml#56]: should work with indentation as well
xml = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(new Simple());
assertEquals("<Simple a=\"13\">something</Simple>\n", xml);
assertEquals("<Simple a=\"13\">something</Simple>", xml);
}

public void testDeserializeAsText() throws IOException
Expand Down