Buggy code:
public class LangUtil { private static final Map VM_CLASSES ; public static final String EOL ; public static final boolean supportsJava ( String version ) { } private static boolean is13VMOrGreater = true ; private static boolean is14VMOrGreater = true ; private static boolean is15VMOrGreater = false ; public static boolean is13VMOrGreater ( ) { } public static boolean is14VMOrGreater ( ) { } public static boolean is15VMOrGreater ( ) { } public static final void throwIaxIfNull ( final Object o , final String name ) { } public static final void throwIaxIfNotAssignable ( final Object [ ] ra , final Class c , final String name ) { } public static final void throwIaxIfNotAssignable ( final Object o , final Class c , final String name ) { } public static final void throwIaxIfNotAllAssignable ( final Collection collection , final Class c , final String name ) { } public static final void throwIaxIfFalse ( final boolean test , final String message ) { } public static boolean isEmptyTrimmed ( String s ) { } public static boolean isEmpty ( String s ) { } public static boolean isEmpty ( Object [ ] ra ) { } public static boolean isEmpty ( Collection collection ) { } public static String [ ] split ( String text ) { } public static List commaSplit ( String input ) { } public static String [ ] splitClasspath ( String classpath ) { } public static boolean getBoolean ( String propertyName , boolean defaultValue ) { } public static List anySplit ( String input , String delim ) { } public static List strings ( String text ) { } public static List safeList ( List list ) { } public static String [ ] endsWith ( String [ ] inputs , String [ ] suffixes , boolean ignoreCase ) { } public static String [ ] selectDirectories ( String [ ] inputs , File baseDir ) { } public static String [ ] [ ] copyStrings ( String [ ] [ ] in ) { } public static String [ ] extractOptions ( String [ ] args , String [ ] [ ] options ) { } public static String [ ] extractOptions ( String [ ] args , String [ ] validOptions , int [ ] optionArgs , List extracted ) { } public static String [ ] selectOptions ( String [ ] args , String [ ] validOptions ) { } public static String [ ] selectOptions ( List args , String [ ] validOptions ) { } public static String [ ] [ ] optionVariants ( String [ ] options ) { } private static int exp ( int base , int power ) { } public static final Object [ ] copy ( Object [ ] source ) { } public static Object [ ] safeCopy ( Object [ ] source , Object [ ] sink ) { } public static String unqualifiedClassName ( Class c ) { } public static String unqualifiedClassName ( Object o ) { } public static String replace ( String in , String sought , String replace ) { if ( ( LangUtil . isEmpty ( in ) ) || ( LangUtil . isEmpty ( sought ) ) ) { return in ; } StringBuffer result = new StringBuffer ( ) ; final int len = sought . length ( ) ; int start = 0 ; int loc ; while ( ( - 1 ) != ( loc = in . indexOf ( sought , start ) ) ) { result . append ( in . substring ( start , loc ) ) ; if ( ! ( LangUtil . isEmpty ( replace ) ) ) { <START_BUG> result . append ( in . substring ( start , loc ) ) ; <END_BUG> } start = loc + len ; } result . append ( in . substring ( start ) ) ; return result . toString ( ) ; } public static String toSizedString ( long i , int width ) { } static String clipBuffer ( StringBuffer buffer , int maxLines ) { } public static String renderExceptionShort ( Throwable e ) { } public static String renderException ( Throwable t ) { } public static String renderException ( Throwable t , boolean elide ) { } static void elideEndingLines ( LangUtil . StringChecker checker , StringBuffer stack , int maxLines ) { } public static StringBuffer stackToString ( Throwable throwable , boolean skipMessage ) { } public static Throwable unwrapException ( Throwable t ) { } public static List arrayAsList ( Object [ ] array ) { } public static class StringChecker { static LangUtil . StringChecker TEST_PACKAGES = new LangUtil . StringChecker ( new String [ ] { "org.aspectj.testing" , "org.eclipse.jdt.internal.junit" , "junit.framework." , "org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" } ) ; String [ ] infixes ; StringChecker ( String [ ] infixes ) { } public boolean acceptString ( String input ) { } } public static String makeClasspath ( String bootclasspath , String classpath , String classesDir , String outputJar ) { } private static boolean addIfNotEmpty ( String input , StringBuffer sink , String delimiter ) { } public static LangUtil . ProcessController makeProcess ( LangUtil . ProcessController controller , String classpath , String mainClass , String [ ] args ) { } public static LangUtil . ProcessController makeProcess ( LangUtil . ProcessController controller , String [ ] command , String label ) { } public static File getJavaExecutable ( ) { } public static boolean sleep ( long milliseconds ) { } public static boolean sleepUntil ( long time ) { } public static class ProcessController { private String [ ] command ; private String [ ] envp ; private String label ; private boolean init ; private boolean started ; private boolean completed ; private boolean userStopped ; private Process process ; private Pipe errStream ; private Pipe outStream ; private Pipe inStream ;

Fix:
result . append ( replace ) ;