diff --git a/src/main/java/com/fasterxml/jackson/dataformat/xml/ser/ToXmlGenerator.java b/src/main/java/com/fasterxml/jackson/dataformat/xml/ser/ToXmlGenerator.java index 2e5c8a552..ba0ae17d5 100644 --- a/src/main/java/com/fasterxml/jackson/dataformat/xml/ser/ToXmlGenerator.java +++ b/src/main/java/com/fasterxml/jackson/dataformat/xml/ser/ToXmlGenerator.java @@ -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); } diff --git a/src/test/java/com/fasterxml/jackson/dataformat/xml/misc/TextValueTest.java b/src/test/java/com/fasterxml/jackson/dataformat/xml/misc/TextValueTest.java index c2bdb7aff..b7693a5c8 100644 --- a/src/test/java/com/fasterxml/jackson/dataformat/xml/misc/TextValueTest.java +++ b/src/test/java/com/fasterxml/jackson/dataformat/xml/misc/TextValueTest.java @@ -104,7 +104,7 @@ public void testSerializeAsText() throws IOException assertEquals("something", xml); // [dataformat-xml#56]: should work with indentation as well xml = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(new Simple()); - assertEquals("something\n", xml); + assertEquals("something", xml); } public void testDeserializeAsText() throws IOException