Buggy code:
public class StrBuilderTest extends TestCase { public static void main ( String [ ] args ) { } public static Test suite ( ) { } public StrBuilderTest ( String name ) { } public void testConstructors ( ) { } public void testChaining ( ) { } public void testCapacityAndLength ( ) { } public void testLength ( ) { } public void testSetLength ( ) { } public void testCapacity ( ) { } public void testEnsureCapacity ( ) { } public void testMinimizeCapacity ( ) { } public void testSize ( ) { } public void testIsEmpty ( ) { } public void testClear ( ) { } public void testCharAt ( ) { } public void testSetCharAt ( ) { } public void testDeleteCharAt ( ) { } public void testToCharArray ( ) { } public void testToCharArrayIntInt ( ) { } public void testGetChars ( ) { } public void testGetCharsIntIntCharArrayInt ( ) { } public void testNullText ( ) { } public void testDeleteIntInt ( ) { } public void testDeleteAll_char ( ) { } public void testDeleteFirst_char ( ) { } public void testDeleteAll_String ( ) { } public void testDeleteFirst_String ( ) { } public void testDeleteAll_StrMatcher ( ) { } public void testDeleteFirst_StrMatcher ( ) { } public void testReplace_int_int_String ( ) { } public void testReplaceAll_char_char ( ) { } public void testReplaceFirst_char_char ( ) { StrBuilder sb = new StrBuilder ( "abcbccba" ) ; sb . replaceFirst ( 'x' , 'y' ) ; assertEquals ( "abcbccba" , sb . toString ( ) ) ; sb . replaceFirst ( 'a' , 'd' ) ; assertEquals ( "dbcbccba" , sb . toString ( ) ) ; sb . replaceFirst ( 'b' , 'e' ) ; assertEquals ( "decbccba" , sb . toString ( ) ) ; sb . replaceFirst ( 'c' , 'f' ) ; assertEquals ( "defbccba" , sb . toString ( ) ) ; <START_BUG> sb . replaceAll ( 'd' , 'd' ) ; <END_BUG> assertEquals ( "defbccba" , sb . toString ( ) ) ; } public void testReplaceAll_String_String ( ) { } public void testReplaceFirst_String_String ( ) { } public void testReplaceAll_StrMatcher_String ( ) { } public void testReplaceFirst_StrMatcher_String ( ) { } public void testReplace_StrMatcher_String_int_int_int_VaryMatcher ( ) { } public void testReplace_StrMatcher_String_int_int_int_VaryReplace ( ) { } public void testReplace_StrMatcher_String_int_int_int_VaryStartIndex ( ) { } public void testReplace_StrMatcher_String_int_int_int_VaryEndIndex ( ) { } public void testReplace_StrMatcher_String_int_int_int_VaryCount ( ) { } public void testReverse ( ) { } public void testStartsWith ( ) { } public void testEndsWith ( ) { } public void testSubstringInt ( ) { } public void testSubstringIntInt ( ) { } public void testMidString ( ) { } public void testRightString ( ) { } public void testLeftString ( ) { } public void testContains_char ( ) { } public void testContains_String ( ) { } public void testContains_StrMatcher ( ) { } public void testIndexOf_char ( ) { } public void testIndexOf_char_int ( ) { } public void testLastIndexOf_char ( ) { } public void testLastIndexOf_char_int ( ) { } public void testIndexOf_String ( ) { } public void testIndexOf_String_int ( ) { } public void testLastIndexOf_String ( ) { } public void testLastIndexOf_String_int ( ) { } public void testIndexOf_StrMatcher ( ) { } public void testIndexOf_StrMatcher_int ( ) { } public void testLastIndexOf_StrMatcher ( ) { } public void testLastIndexOf_StrMatcher_int ( ) { } static final StrMatcher A_NUMBER_MATCHER = new StrMatcher ( ) { public int isMatch ( char [ ] buffer , int pos , int bufferStart , int bufferEnd ) { } } ; public void testAsReader ( ) throws Exception { } public void testAsWriter ( ) throws Exception { } public void testToString ( ) { } public void testToStringBuffer ( ) { } }

Fix:
sb . replaceFirst ( 'd' , 'd' ) ;