Skip to content

Commit

Permalink
Backport #336 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 23, 2019
1 parent 81bcf12 commit 882b42c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Project: jackson-dataformat-xml

2.9.10 (not yet released)

#336: WRITE_BIGDECIMAL_AS_PLAIN Not Used When Writing Pretty
(fix contributed by Kevin D)
- Fix a dependency discrepancy for `stax2-api`: was depending on older version
than what `woodstox-core` needs (3.1.4 vs 4.1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1135,9 +1135,15 @@ public void writeNumber(BigDecimal dec) throws IOException
}
} else {
if (_xmlPrettyPrinter != null) {
_xmlPrettyPrinter.writeLeafElement(_xmlWriter,
_nextName.getNamespaceURI(), _nextName.getLocalPart(),
dec);
if (usePlain) {
_xmlPrettyPrinter.writeLeafElement(_xmlWriter,
_nextName.getNamespaceURI(), _nextName.getLocalPart(),
dec.toPlainString(), false);
} else {
_xmlPrettyPrinter.writeLeafElement(_xmlWriter,
_nextName.getNamespaceURI(), _nextName.getLocalPart(),
dec);
}
} else {
_xmlWriter.writeStartElement(_nextName.getNamespaceURI(), _nextName.getLocalPart());
if (usePlain) {
Expand Down

0 comments on commit 882b42c

Please sign in to comment.