Skip to content

Commit 4390cd0

Browse files
poutsmarstoyanchev
authored andcommitted
Fixed Jaxb2CollectionHttpMessageConverterTests
- Added Woodstox before Aalto in the spring-web build, so that Woodstox is used as StAX implementation, and not the less featured Aalto. - Hardcoded Aalto dependency in XmlEventDecoder, instead of relying on the StAX XMLInputFactory.
1 parent 5d1b542 commit 4390cd0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ configure(allprojects) { project ->
7777
ext.tomcatVersion = "8.5.3"
7878
ext.tyrusVersion = "1.13"
7979
ext.undertowVersion = "1.4.0.CR3"
80+
ext.woodstoxVersion = "5.0.2"
8081
ext.xmlunitVersion = "1.6"
8182
ext.xstreamVersion = "1.4.9"
8283

@@ -369,7 +370,7 @@ project("spring-core") {
369370
optional("io.netty:netty-buffer:${nettyVersion}")
370371
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
371372
testCompile("xmlunit:xmlunit:${xmlunitVersion}")
372-
testCompile("com.fasterxml.woodstox:woodstox-core:5.0.2") {
373+
testCompile("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") {
373374
exclude group: "stax", module: "stax-api"
374375
}
375376
}
@@ -691,6 +692,9 @@ project("spring-web") {
691692
optional("io.reactivex:rxjava:${rxJavaVersion}")
692693
optional("io.undertow:undertow-core:1.3.20.Final")
693694
optional("io.netty:netty-buffer:${nettyVersion}") // Temporarily for JsonObjectDecoder
695+
optional("com.fasterxml.woodstox:woodstox-core:${woodstoxVersion}") { // woodstox before aalto
696+
exclude group: "stax", module: "stax-api"
697+
}
694698
optional("com.fasterxml:aalto-xml:1.0.0")
695699
optional("org.apache.httpcomponents:httpclient:${httpclientVersion}")
696700
optional("org.apache.httpcomponents:httpasyncclient:${httpasyncVersion}")
@@ -725,6 +729,7 @@ project("spring-web") {
725729
testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}")
726730
testCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}")
727731
testCompile("com.squareup.okhttp3:mockwebserver:3.0.1")
732+
728733
}
729734
}
730735

spring-web/src/main/java/org/springframework/http/codec/xml/XmlEventDecoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.fasterxml.aalto.AsyncXMLInputFactory;
3131
import com.fasterxml.aalto.AsyncXMLStreamReader;
3232
import com.fasterxml.aalto.evt.EventAllocatorImpl;
33+
import com.fasterxml.aalto.stax.InputFactoryImpl;
3334
import org.reactivestreams.Publisher;
3435
import reactor.core.publisher.Flux;
3536
import reactor.core.publisher.Mono;
@@ -116,8 +117,7 @@ public Flux<XMLEvent> decode(Publisher<DataBuffer> inputStream, ResolvableType e
116117
private static class AaltoDataBufferToXmlEvent
117118
implements Function<DataBuffer, Publisher<? extends XMLEvent>> {
118119

119-
private static final AsyncXMLInputFactory inputFactory =
120-
(AsyncXMLInputFactory) XmlEventDecoder.inputFactory;
120+
private static final AsyncXMLInputFactory inputFactory = new InputFactoryImpl();
121121

122122
private final AsyncXMLStreamReader<AsyncByteBufferFeeder> streamReader =
123123
inputFactory.createAsyncForByteBuffer();

0 commit comments

Comments
 (0)