Skip to content

Commit 6fefce7

Browse files
committed
...
1 parent a30f875 commit 6fefce7

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/main/java/com/fasterxml/jackson/dataformat/xml/deser/FromXmlParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public void close() throws IOException
356356
if (!_closed) {
357357
_closed = true;
358358
try {
359-
if (_ioContext.isResourceManaged() || isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) {
359+
if (_ioContext.isResourceManaged() || isEnabled(StreamReadFeature.AUTO_CLOSE_SOURCE)) {
360360
_xmlTokens.closeCompletely();
361361
} else {
362362
_xmlTokens.close();

src/main/java/com/fasterxml/jackson/dataformat/xml/ser/ToXmlGenerator.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ public void writeNumber(BigDecimal dec) throws IOException
10281028
if (_nextName == null) {
10291029
handleMissingName();
10301030
}
1031-
boolean usePlain = isEnabled(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN);
1031+
boolean usePlain = isEnabled(StreamWriteFeature.WRITE_BIGDECIMAL_AS_PLAIN);
10321032
try {
10331033
if (_nextIsAttribute) {
10341034
if (usePlain) {
@@ -1126,7 +1126,7 @@ protected final void _verifyValueWrite(String typeMsg) throws IOException
11261126
@Override
11271127
public void flush() throws IOException
11281128
{
1129-
if (isEnabled(JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM)) {
1129+
if (isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM)) {
11301130
try {
11311131
_xmlWriter.flush();
11321132
} catch (XMLStreamException e) {
@@ -1142,15 +1142,10 @@ public void close() throws IOException
11421142
super.close();
11431143

11441144
// First: let's see that we still have buffers...
1145-
if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_CONTENT)) {
1145+
if (isEnabled(StreamWriteFeature.AUTO_CLOSE_CONTENT)) {
11461146
try {
11471147
while (true) {
1148-
/* 28-May-2016, tatu: To work around incompatibility introduced by
1149-
* `jackson-core` 2.8 where return type of `getOutputContext()`
1150-
* changed, let's do direct access here.
1151-
*/
1152-
// JsonStreamContext ctxt = getOutputContext();
1153-
TokenStreamContext ctxt = _outputContext;
1148+
TokenStreamContext ctxt = getOutputContext();
11541149
if (ctxt.inArray()) {
11551150
writeEndArray();
11561151
} else if (ctxt.inObject()) {
@@ -1160,14 +1155,13 @@ public void close() throws IOException
11601155
}
11611156
}
11621157
} catch (ArrayIndexOutOfBoundsException e) {
1163-
/* 29-Nov-2010, tatu: Stupid, stupid SJSXP doesn't do array checks, so we get
1164-
* hit by this as a collateral problem in some cases. Yuck.
1165-
*/
1158+
// 29-Nov-2010, tatu: Stupid, stupid SJSXP doesn't do array checks, so we get
1159+
// hit by this as a collateral problem in some cases. Yuck.
11661160
throw new JsonGenerationException(e, this);
11671161
}
11681162
}
11691163
try {
1170-
if (_ioContext.isResourceManaged() || isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)) {
1164+
if (_ioContext.isResourceManaged() || isEnabled(StreamWriteFeature.AUTO_CLOSE_TARGET)) {
11711165
_xmlWriter.closeCompletely();
11721166
} else {
11731167
_xmlWriter.close();

0 commit comments

Comments
 (0)