Skip to content

Commit 5d2c79b

Browse files
committed
Fixed #222
1 parent 87ce6e2 commit 5d2c79b

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

release-notes/VERSION

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Project: jackson-dataformat-xml
88

99
No changes since 2.7.
1010

11+
2.7.10 (not yet released)
12+
13+
#222: DefaultXmlPrettyPrinter indentation configuration not preserved
14+
(reported by jtuc@github)
15+
1116
2.7.9 (04-Feb-2017)
1217

1318
No changes since 2.7.8

src/main/java/com/fasterxml/jackson/dataformat/xml/util/DefaultXmlPrettyPrinter.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public interface Indenter
9393
* is encountered. Used for suppressing indentation to allow empty
9494
* elements.
9595
*
96-
* @since 2.3.0
96+
* @since 2.3
9797
*/
9898
protected transient boolean _justHadStartElement;
9999

@@ -105,6 +105,14 @@ public interface Indenter
105105

106106
public DefaultXmlPrettyPrinter() { }
107107

108+
protected DefaultXmlPrettyPrinter(DefaultXmlPrettyPrinter base)
109+
{
110+
_arrayIndenter = base._arrayIndenter;
111+
_objectIndenter = base._objectIndenter;
112+
_spacesInObjectEntries = base._spacesInObjectEntries;
113+
_nesting = base._nesting;
114+
}
115+
108116
public void indentArraysWith(Indenter i)
109117
{
110118
_arrayIndenter = (i == null) ? new NopIndenter() : i;
@@ -125,7 +133,7 @@ public void indentObjectsWith(Indenter i)
125133

126134
@Override
127135
public DefaultXmlPrettyPrinter createInstance() {
128-
return new DefaultXmlPrettyPrinter();
136+
return new DefaultXmlPrettyPrinter(this);
129137
}
130138

131139
/*

0 commit comments

Comments
 (0)