Buggy code:
public String toString ( ) { } private void doPut ( final K key , final V value ) { } private V doRemoveKey ( Object key ) { } private K doRemoveValue ( Object value ) { } @ SuppressWarnings ( "unchecked" ) private < T extends Comparable < T > > TreeBidiMap . Node < K , V > lookup ( final Object data , final TreeBidiMap . DataElement dataElement ) { } private TreeBidiMap . Node < K , V > lookupKey ( Object key ) { } private TreeBidiMap . Node < K , V > lookupValue ( Object value ) { } private TreeBidiMap . Node < K , V > nextGreater ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private TreeBidiMap . Node < K , V > nextSmaller ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private static < T extends Comparable < T > > int compare ( final T o1 , final T o2 ) { } private TreeBidiMap . Node < K , V > leastNode ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private TreeBidiMap . Node < K , V > greatestNode ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private void copyColor ( final TreeBidiMap . Node < K , V > from , final TreeBidiMap . Node < K , V > to , final TreeBidiMap . DataElement dataElement ) { } private static boolean isRed ( final TreeBidiMap . Node < ? , ? > node , final TreeBidiMap . DataElement dataElement ) { } private static boolean isBlack ( final TreeBidiMap . Node < ? , ? > node , final TreeBidiMap . DataElement dataElement ) { } private static void makeRed ( final TreeBidiMap . Node < ? , ? > node , final TreeBidiMap . DataElement dataElement ) { } private static void makeBlack ( final TreeBidiMap . Node < ? , ? > node , final TreeBidiMap . DataElement dataElement ) { } private TreeBidiMap . Node < K , V > getGrandParent ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private TreeBidiMap . Node < K , V > getParent ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private TreeBidiMap . Node < K , V > getRightChild ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private TreeBidiMap . Node < K , V > getLeftChild ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private void rotateLeft ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private void rotateRight ( final TreeBidiMap . Node < K , V > node , final TreeBidiMap . DataElement dataElement ) { } private void doRedBlackInsert ( final TreeBidiMap . Node < K , V > insertedNode , final TreeBidiMap . DataElement dataElement ) { } private void doRedBlackDelete ( final TreeBidiMap . Node < K , V > deletedNode ) { } private void doRedBlackDeleteFixup ( final TreeBidiMap . Node < K , V > replacementNode , final TreeBidiMap . DataElement dataElement ) { } private void swapPosition ( final TreeBidiMap . Node < K , V > x , final TreeBidiMap . Node < K , V > y , final TreeBidiMap . DataElement dataElement ) { } private static void checkNonNullComparable ( final Object o , final TreeBidiMap . DataElement dataElement ) { } private static void checkKey ( final Object key ) { } private static void checkValue ( final Object value ) { } private static void checkKeyAndValue ( final Object key , final Object value ) { } private void modify ( ) { } private void grow ( ) { } private void shrink ( ) { } private void insertValue ( final TreeBidiMap . Node < K , V > newNode ) throws IllegalArgumentException { } private boolean doEquals ( Object obj , TreeBidiMap . DataElement dataElement ) { } private int doHashCode ( TreeBidiMap . DataElement dataElement ) { } private String doToString ( TreeBidiMap . DataElement dataElement ) { if ( ( nodeCount ) == 0 ) { return "{}" ; } <START_BUG> StringBuffer buf = new StringBuffer ( ( ( nodeCount ) * 32 ) ) ; <END_BUG> buf . append ( '{' ) ; MapIterator < ? , ? > it = TreeBidiMap . getMapIterator ( dataElement ) ; boolean hasNext = it . hasNext ( ) ; while ( hasNext ) { Object key = it . next ( ) ; Object value = it . getValue ( ) ; buf . append ( ( key == ( this ) ? "(this<seq2seq4repair_space>Map)" : key ) ) . append ( '=' ) . append ( ( value == ( this ) ? "(this<seq2seq4repair_space>Map)" : value ) ) ; hasNext = it . hasNext ( ) ; if ( hasNext ) { buf . append ( ",<seq2seq4repair_space>" ) ; } } buf . append ( '}' ) ; return buf . toString ( ) ; } private MapIterator < ? , ? > getMapIterator ( TreeBidiMap . DataElement dataElement ) { } abstract class View < E > extends AbstractSet < E > { protected final TreeBidiMap . DataElement orderType ; View ( final TreeBidiMap . DataElement orderType ) { } public int size ( ) { } public void clear ( ) { } }

Fix:
StringBuilder buf = new StringBuilder ( ( ( nodeCount ) * 32 ) ) ;