Buggy code:
public class ListOrderedMap < K , V > extends AbstractMapDecorator < K , V > implements Serializable , OrderedMap < K , V > { private static final long serialVersionUID = 2728177751851003750L ; protected final List < K > insertOrder = new ArrayList < K > ( ) ; public static < K , V > OrderedMap < K , V > decorate ( Map < K , V > map ) { } public ListOrderedMap ( ) { } protected ListOrderedMap ( Map < K , V > map ) { } private void writeObject ( ObjectOutputStream out ) throws IOException { } @ SuppressWarnings ( "unchecked" ) private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } public OrderedMapIterator < K , V > mapIterator ( ) { } public K firstKey ( ) { } public K lastKey ( ) { } public K nextKey ( Object key ) { } public K previousKey ( Object key ) { } public V put ( K key , V value ) { } public void putAll ( Map < ? extends K , ? extends V > map ) { } public void putAll ( int index , Map < ? extends K , ? extends V > map ) { } public V remove ( Object key ) { } public void clear ( ) { } public Set < K > keySet ( ) { } public List < K > keyList ( ) { } public Collection < V > values ( ) { } public List < V > valueList ( ) { } public Set < Map . Entry < K , V > > entrySet ( ) { } public String toString ( ) { if ( ListOrderedMap . isEmpty ( ) ) { return "{}" ; } <START_BUG> StringBuffer buf = new StringBuffer ( ) ; <END_BUG> buf . append ( '{' ) ; boolean first = true ; for ( Map . Entry < K , V > entry : entrySet ( ) ) { K key = entry . getKey ( ) ; V value = entry . getValue ( ) ; if ( first ) { first = false ; } else { buf . append ( ",<seq2seq4repair_space>" ) ; } buf . append ( ( key == ( this ) ? "(this<seq2seq4repair_space>Map)" : key ) ) ; buf . append ( '=' ) ; buf . append ( ( value == ( this ) ? "(this<seq2seq4repair_space>Map)" : value ) ) ; } buf . append ( '}' ) ; return buf . toString ( ) ; } public K get ( int index ) { } public V getValue ( int index ) { } public int indexOf ( Object key ) { } public V setValue ( int index , V value ) { } public V put ( int index , K key , V value ) { } public V remove ( int index ) { } public List < K > asList ( ) { } static class ValuesView < V > extends AbstractList < V > { private final ListOrderedMap < Object , V > parent ; @ SuppressWarnings ( "unchecked" ) ValuesView ( ListOrderedMap < ? , V > parent ) { } public int size ( ) { } public boolean contains ( Object value ) { } public void clear ( ) { } public Iterator < V > iterator ( ) { } public V get ( int index ) { } public V set ( int index , V value ) { } public V remove ( int index ) { } } static class KeySetView < K > extends AbstractSet < K > { private final ListOrderedMap < K , Object > parent ; @ SuppressWarnings ( "unchecked" ) KeySetView ( ListOrderedMap < K , ? > parent ) { } public int size ( ) { } public boolean contains ( Object value ) { } public void clear ( ) { } public Iterator < K > iterator ( ) { } } static class EntrySetView < K , V > extends AbstractSet < Map . Entry < K , V > > { private final ListOrderedMap < K , V > parent ; private final List < K > insertOrder ; private Set < Map . Entry < K , V > > entrySet ; public EntrySetView ( ListOrderedMap < K , V > parent , List < K > insertOrder ) { } private Set < Map . Entry < K , V > > getEntrySet ( ) { } public int size ( ) { } public boolean isEmpty ( ) { } public boolean contains ( Object obj ) { } public boolean containsAll ( Collection < ? > coll ) { } @ SuppressWarnings ( "unchecked" ) public boolean remove ( Object obj ) { } public void clear ( ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } public String toString ( ) { return getEntrySet ( ) . toString ( ) ; } public Iterator < Map . Entry < K , V > > iterator ( ) { } } static class ListOrderedIterator < K , V > extends AbstractUntypedIteratorDecorator < K , Map . Entry < K , V > > { private final ListOrderedMap < K , V > parent ; private K last = null ; ListOrderedIterator ( ListOrderedMap < K , V > parent , List < K > insertOrder ) { } public Map . Entry < K , V > next ( ) { } public void remove ( ) { } } static class ListOrderedMapEntry < K , V > extends AbstractMapEntry < K , V > { private final ListOrderedMap < K , V > parent ;

Fix:
StringBuilder buf = new StringBuilder ( ) ;