Skip to content

Commit

Permalink
Fixed #222
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 15, 2017
1 parent 87ce6e2 commit 5d2c79b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Project: jackson-dataformat-xml

No changes since 2.7.

2.7.10 (not yet released)

#222: DefaultXmlPrettyPrinter indentation configuration not preserved
(reported by jtuc@github)

2.7.9 (04-Feb-2017)

No changes since 2.7.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public interface Indenter
* is encountered. Used for suppressing indentation to allow empty
* elements.
*
* @since 2.3.0
* @since 2.3
*/
protected transient boolean _justHadStartElement;

Expand All @@ -105,6 +105,14 @@ public interface Indenter

public DefaultXmlPrettyPrinter() { }

protected DefaultXmlPrettyPrinter(DefaultXmlPrettyPrinter base)
{
_arrayIndenter = base._arrayIndenter;
_objectIndenter = base._objectIndenter;
_spacesInObjectEntries = base._spacesInObjectEntries;
_nesting = base._nesting;
}

public void indentArraysWith(Indenter i)
{
_arrayIndenter = (i == null) ? new NopIndenter() : i;
Expand All @@ -125,7 +133,7 @@ public void indentObjectsWith(Indenter i)

@Override
public DefaultXmlPrettyPrinter createInstance() {
return new DefaultXmlPrettyPrinter();
return new DefaultXmlPrettyPrinter(this);
}

/*
Expand Down

0 comments on commit 5d2c79b

Please sign in to comment.