Skip to content

Commit 1a8629d

Browse files
committed
Fix failing test
1 parent d90a361 commit 1a8629d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ protected void writeToResult(T t, HttpHeaders headers, Result result) throws IOE
229229
*/
230230
protected XMLInputFactory createXmlInputFactory() {
231231
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
232-
inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);
232+
inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
233233
return inputFactory;
234234
}
235235

spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverterTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public void readXmlTypeSet() throws Exception {
126126

127127
@Test
128128
@SuppressWarnings("unchecked")
129-
public void readXmlRootElementWithExternalEntity() throws Exception {
129+
public void readXmlRootElementExternalEntityDisabled() throws Exception {
130130

131131
Resource external = new ClassPathResource("external.txt", getClass());
132132
String content = "<!DOCTYPE root [" +
@@ -151,7 +151,6 @@ public void readXmlRootElementExternalEntityEnabled() throws Exception {
151151
" <list><rootElement><type s=\"1\"/><external>&ext;</external></rootElement></list>";
152152
MockHttpInputMessage inputMessage = new MockHttpInputMessage(content.getBytes("UTF-8"));
153153

154-
// Now read with
155154
Jaxb2CollectionHttpMessageConverter<?> c = new Jaxb2CollectionHttpMessageConverter<Collection<Object>>() {
156155
@Override
157156
protected XMLInputFactory createXmlInputFactory() {

0 commit comments

Comments
 (0)