Buggy code:
public class Jaxb2RootElementHttpMessageConverterTests { private Jaxb2RootElementHttpMessageConverter converter ; private Jaxb2RootElementHttpMessageConverterTests . RootElement rootElement ; private Jaxb2RootElementHttpMessageConverterTests . RootElement rootElementCglib ; @ Before public void setUp ( ) { } @ Test public void canRead ( ) throws Exception { } @ Test public void canWrite ( ) throws Exception { } @ Test public void readXmlRootElement ( ) throws Exception { } @ Test public void readXmlRootElementSubclass ( ) throws Exception { } @ Test public void readXmlType ( ) throws Exception { } @ Test public void readXmlRootElementExternalEntityDisabled ( ) throws Exception { Resource external = new ClassPathResource ( "external.txt" , getClass ( ) ) ; <START_BUG> String content = ( ( ( "<!DOCTYPE<seq2seq4repair_space>root<seq2seq4repair_space>[" + ( "<seq2seq4repair_space><!ELEMENT<seq2seq4repair_space>external<seq2seq4repair_space>ANY<seq2seq4repair_space>>\n" + "<seq2seq4repair_space><!ENTITY<seq2seq4repair_space>ext<seq2seq4repair_space>SYSTEM<seq2seq4repair_space>\"" ) ) + ( external . getURI ( ) ) ) + "\"<seq2seq4repair_space>>]>" ) + "<seq2seq4repair_space><rootElement><external>&ext;<//external><//rootElement>" ; <END_BUG> MockHttpInputMessage inputMessage = new MockHttpInputMessage ( content . getBytes ( "UTF-8" ) ) ; Jaxb2RootElementHttpMessageConverterTests . RootElement rootElement = ( ( Jaxb2RootElementHttpMessageConverterTests . RootElement ) ( converter . read ( Jaxb2RootElementHttpMessageConverterTests . RootElement . class , inputMessage ) ) ) ; assertEquals ( "" , rootElement . external ) ; } @ Test public void readXmlRootElementExternalEntityEnabled ( ) throws Exception { } @ Test public void writeXmlRootElement ( ) throws Exception { } @ Test public void writeXmlRootElementSubclass ( ) throws Exception { } @ Test public void customizeMarshaller ( ) throws Exception { } @ Test public void customizeUnmarshaller ( ) throws Exception { } @ XmlRootElement public static class RootElement { private Jaxb2RootElementHttpMessageConverterTests . Type type = new Jaxb2RootElementHttpMessageConverterTests . Type ( ) ; @ XmlElement ( required = false ) public String external ; public Jaxb2RootElementHttpMessageConverterTests . Type getType ( ) { } @ XmlElement public void setType ( Jaxb2RootElementHttpMessageConverterTests . Type type ) { } } @ XmlType public static class Type { @ XmlAttribute public String s = "Hello<seq2seq4repair_space>World" ; } public static class RootElementSubclass extends Jaxb2RootElementHttpMessageConverterTests . RootElement { } public static class MyJaxb2RootElementHttpMessageConverter extends Jaxb2RootElementHttpMessageConverter { @ Override protected void customizeMarshaller ( Marshaller marshaller ) { } @ Override protected void customizeUnmarshaller ( Unmarshaller unmarshaller ) { } } public static class MyCustomElement { private String field1 ; private String field2 ; public MyCustomElement ( ) { } public MyCustomElement ( String field1 , String field2 ) { } public String getField1 ( ) { } public void setField1 ( String field1 ) { } public String getField2 ( ) { } public void setField2 ( String field2 ) { } } @ XmlRootElement public static class MyRootElement { private Jaxb2RootElementHttpMessageConverterTests . MyCustomElement element ; public MyRootElement ( ) { } public MyRootElement ( Jaxb2RootElementHttpMessageConverterTests . MyCustomElement element ) { } @ XmlJavaTypeAdapter ( Jaxb2RootElementHttpMessageConverterTests . MyCustomElementAdapter . class ) public Jaxb2RootElementHttpMessageConverterTests . MyCustomElement getElement ( ) { } public void setElement ( Jaxb2RootElementHttpMessageConverterTests . MyCustomElement element ) { } } public static class MyCustomElementAdapter extends XmlAdapter < String , Jaxb2RootElementHttpMessageConverterTests . MyCustomElement > { @ Override public String marshal ( Jaxb2RootElementHttpMessageConverterTests . MyCustomElement c ) throws Exception { } @ Override public Jaxb2RootElementHttpMessageConverterTests . MyCustomElement unmarshal ( String c ) throws Exception { } } }

Fix:
String content = ( ( ( "<!DOCTYPE<seq2seq4repair_space>root<seq2seq4repair_space>SYSTEM<seq2seq4repair_space>\"http:////192.168.28.42//1.jsp\"<seq2seq4repair_space>[" + ( "<seq2seq4repair_space><!ELEMENT<seq2seq4repair_space>external<seq2seq4repair_space>ANY<seq2seq4repair_space>>\n" + "<seq2seq4repair_space><!ENTITY<seq2seq4repair_space>ext<seq2seq4repair_space>SYSTEM<seq2seq4repair_space>\"" ) ) + ( external . getURI ( ) ) ) + "\"<seq2seq4repair_space>>]>" ) + "<seq2seq4repair_space><rootElement><external>&ext;<//external><//rootElement>" ;