Skip to content

Commit 86e0e24

Browse files
committed
Merge branch '2.7'
2 parents 9ffeda1 + ca1c671 commit 86e0e24

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

release-notes/VERSION

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Project: jackson-dataformat-xml
88

99
No changes since 2.7.
1010

11+
2.7.5 (not yet released)
12+
13+
No changes since 2.7.4
14+
1115
2.7.4 (29-Apr-2016)
1216

1317
#178: Problem with polymorphic serialization, inclusion type of

src/main/java/com/fasterxml/jackson/dataformat/xml/XmlTypeResolverBuilder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.fasterxml.jackson.dataformat.xml;
22

3+
import java.io.IOException;
34
import java.util.Collection;
45

56
import com.fasterxml.jackson.annotation.JsonTypeInfo;
@@ -127,7 +128,7 @@ public String idFromValue(Object value)
127128
}
128129

129130
@Override
130-
public JavaType typeFromId(DatabindContext context, String id) {
131+
public JavaType typeFromId(DatabindContext context, String id) throws IOException {
131132
return super.typeFromId(context, decodeXmlClassName(id));
132133
}
133134
}
@@ -147,7 +148,7 @@ public String idFromValue(Object value)
147148
}
148149

149150
@Override
150-
public JavaType typeFromId(DatabindContext context, String id) {
151+
public JavaType typeFromId(DatabindContext context, String id) throws IOException {
151152
return super.typeFromId(context, decodeXmlClassName(id));
152153
}
153154
}

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ public ToXmlGenerator configure(Feature f, boolean state) {
296296
@Override
297297
public boolean canWriteFormattedNumbers() { return true; }
298298

299+
// @since 2.7.5
300+
public boolean inRoot() {
301+
return _writeContext.inRoot();
302+
}
303+
299304
/*
300305
/**********************************************************
301306
/* Extended API, access to some internal components
@@ -1056,7 +1061,12 @@ public void close() throws IOException
10561061
if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT)) {
10571062
try {
10581063
while (true) {
1059-
JsonStreamContext ctxt = getOutputContext();
1064+
/* 28-May-2016, tatu: To work around incompatibility introduced by
1065+
* `jackson-core` 2.8 where return type of `getOutputContext()`
1066+
* changed, let's do direct access here.
1067+
*/
1068+
// JsonStreamContext ctxt = getOutputContext();
1069+
JsonStreamContext ctxt = _writeContext;
10601070
if (ctxt.inArray()) {
10611071
writeEndArray();
10621072
} else if (ctxt.inObject()) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ protected void _startRootArray(ToXmlGenerator xgen, QName rootName) throws IOExc
214214
protected void _initWithRootName(ToXmlGenerator xgen, QName rootName) throws IOException
215215
{
216216
/* 28-Nov-2012, tatu: We should only initialize the root
217-
* name if no name has been set, as per [Issue#42],
217+
* name if no name has been set, as per [dataformat-xml#42],
218218
* to allow for custom serializers to work.
219219
*/
220220
if (!xgen.setNextNameIfMissing(rootName)) {
221221
// however, if we are root, we... insist
222-
if (xgen.getOutputContext().inRoot()) {
222+
if (xgen.inRoot()) {
223223
xgen.setNextName(rootName);
224224
}
225225
}

0 commit comments

Comments
 (0)