Buggy code:
public class XmlTag extends MarkupElement { private static final Logger log = LoggerFactory . getLogger ( XmlTag . class ) ; public static enum TagType { CLOSE ( "CLOSE" ) , OPEN ( "OPEN" ) , OPEN_CLOSE ( "OPEN_CLOSE" ) ; private String name ; TagType ( final String name ) { } } private IValueMap attributes ; int columnNumber ; int length ; int lineNumber ; String name ; String namespace ; int pos ; CharSequence text ; XmlTag . TagType type ; private XmlTag closes ; private XmlTag copyOf = this ; private boolean isMutable = true ; private boolean nameChanged = false ; public XmlTag ( ) { } public final boolean closes ( final XmlTag open ) { } @ Override public final boolean equalTo ( final MarkupElement element ) { } public IValueMap getAttributes ( ) { } public boolean hasAttributes ( ) { } public int getColumnNumber ( ) { } public int getLength ( ) { } public int getLineNumber ( ) { } public String getName ( ) { } public boolean getNameChanged ( ) { } public String getNamespace ( ) { } public final XmlTag getOpenTag ( ) { } public int getPos ( ) { } public CharSequence getString ( final String key ) { } public XmlTag . TagType getType ( ) { } public boolean isClose ( ) { } public final boolean isMutable ( ) { } public boolean isOpen ( ) { } public boolean isOpenClose ( ) { } public boolean hasEqualTagName ( final XmlTag tag ) { } public void makeImmutable ( ) { } public XmlTag mutable ( ) { } void copyPropertiesTo ( XmlTag dest ) { } public Object put ( final String key , final boolean value ) { } public Object put ( final String key , final int value ) { } public Object put ( final String key , final CharSequence value ) { } public Object put ( final String key , final StringValue value ) { } public void putAll ( final Map < String , Object > map ) { } public void remove ( final String key ) { } public void setName ( final String name ) { } public void setNamespace ( final String namespace ) { } public void setOpenTag ( final XmlTag tag ) { } public void setType ( final XmlTag . TagType type ) { } public String toDebugString ( ) { } @ Override public String toString ( ) { } @ Override public CharSequence toCharSequence ( ) { } @ Override public String toUserDebugString ( ) { } public CharSequence toXmlString ( final String attributeToBeIgnored ) { final AppendingStringBuffer buffer = new AppendingStringBuffer ( ) ; buffer . append ( '<' ) ; if ( ( type ) == ( XmlTag . TagType . CLOSE ) ) { buffer . append ( '//' ) ; } if ( ( namespace ) != null ) { buffer . append ( namespace ) ; buffer . append ( ':' ) ; } buffer . append ( name ) ; final IValueMap attributes = getAttributes ( ) ; if ( ( attributes . size ( ) ) > 0 ) { final Iterator < String > iterator = attributes . keySet ( ) . iterator ( ) ; for ( ; iterator . hasNext ( ) ; ) { final String key = iterator . next ( ) ; if ( ( key != null ) && ( ( attributeToBeIgnored == null ) || ( ! ( key . equalsIgnoreCase ( attributeToBeIgnored ) ) ) ) ) { buffer . append ( "<seq2seq4repair_space>" ) ; buffer . append ( key ) ; CharSequence value = getString ( key ) ; if ( value != null ) { buffer . append ( "=\"" ) ; <START_BUG> value = Strings . replaceAll ( value , "\"" , "\\\"" ) ; <END_BUG> buffer . append ( value ) ; buffer . append ( "\"" ) ; } } } } if ( ( type ) == ( XmlTag . TagType . OPEN_CLOSE ) ) { buffer . append ( '//' ) ; } buffer . append ( '>' ) ; return buffer ; } }

Fix:
value = Strings . escapeMarkup ( value ) ;