Buggy code:
public class DescriptiveStatistics implements Serializable , StatisticalSummary { public static final int INFINITE_WINDOW = - 1 ; private static final long serialVersionUID = 4133067267405273064L ; private static final String SET_QUANTILE_METHOD_NAME = "setQuantile" ; protected int windowSize = DescriptiveStatistics . INFINITE_WINDOW ; protected ResizableDoubleArray eDA = new ResizableDoubleArray ( ) ; private UnivariateStatistic meanImpl = new Mean ( ) ; private UnivariateStatistic geometricMeanImpl = new GeometricMean ( ) ; private UnivariateStatistic kurtosisImpl = new Kurtosis ( ) ; private UnivariateStatistic maxImpl = new Max ( ) ; private UnivariateStatistic minImpl = new Min ( ) ; private UnivariateStatistic percentileImpl = new Percentile ( ) ; private UnivariateStatistic skewnessImpl = new Skewness ( ) ; private UnivariateStatistic varianceImpl = new Variance ( ) ; private UnivariateStatistic sumsqImpl = new SumOfSquares ( ) ; private UnivariateStatistic sumImpl = new Sum ( ) ; public DescriptiveStatistics ( ) { } public DescriptiveStatistics ( int window ) { } public DescriptiveStatistics ( DescriptiveStatistics original ) { } public void addValue ( double v ) { } public void removeMostRecentValue ( ) { } public double replaceMostRecentValue ( double v ) { } public double getMean ( ) { } public double getGeometricMean ( ) { } public double getVariance ( ) { } public double getStandardDeviation ( ) { } public double getSkewness ( ) { } public double getKurtosis ( ) { } public double getMax ( ) { } public double getMin ( ) { } public long getN ( ) { } public double getSum ( ) { } public double getSumsq ( ) { } public void clear ( ) { } public int getWindowSize ( ) { } public void setWindowSize ( int windowSize ) { } public double [ ] getValues ( ) { } public double [ ] getSortedValues ( ) { } public double getElement ( int index ) { } public double getPercentile ( double p ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer outBuffer = new StringBuffer ( ) ; <END_BUG> String endl = "\n" ; outBuffer . append ( "DescriptiveStatistics:" ) . append ( endl ) ; outBuffer . append ( "n:<seq2seq4repair_space>" ) . append ( getN ( ) ) . append ( endl ) ; outBuffer . append ( "min:<seq2seq4repair_space>" ) . append ( getMin ( ) ) . append ( endl ) ; outBuffer . append ( "max:<seq2seq4repair_space>" ) . append ( getMax ( ) ) . append ( endl ) ; outBuffer . append ( "mean:<seq2seq4repair_space>" ) . append ( getMean ( ) ) . append ( endl ) ; outBuffer . append ( "std<seq2seq4repair_space>dev:<seq2seq4repair_space>" ) . append ( getStandardDeviation ( ) ) . append ( endl ) ; outBuffer . append ( "median:<seq2seq4repair_space>" ) . append ( getPercentile ( 50 ) ) . append ( endl ) ; outBuffer . append ( "skewness:<seq2seq4repair_space>" ) . append ( getSkewness ( ) ) . append ( endl ) ; outBuffer . append ( "kurtosis:<seq2seq4repair_space>" ) . append ( getKurtosis ( ) ) . append ( endl ) ; return outBuffer . toString ( ) ; } public double apply ( UnivariateStatistic stat ) { } public synchronized UnivariateStatistic getMeanImpl ( ) { } public synchronized void setMeanImpl ( UnivariateStatistic meanImpl ) { } public synchronized UnivariateStatistic getGeometricMeanImpl ( ) { } public synchronized void setGeometricMeanImpl ( UnivariateStatistic geometricMeanImpl ) { } public synchronized UnivariateStatistic getKurtosisImpl ( ) { } public synchronized void setKurtosisImpl ( UnivariateStatistic kurtosisImpl ) { } public synchronized UnivariateStatistic getMaxImpl ( ) { } public synchronized void setMaxImpl ( UnivariateStatistic maxImpl ) { } public synchronized UnivariateStatistic getMinImpl ( ) { } public synchronized void setMinImpl ( UnivariateStatistic minImpl ) { } public synchronized UnivariateStatistic getPercentileImpl ( ) { } public synchronized void setPercentileImpl ( UnivariateStatistic percentileImpl ) { } public synchronized UnivariateStatistic getSkewnessImpl ( ) { } public synchronized void setSkewnessImpl ( UnivariateStatistic skewnessImpl ) { } public synchronized UnivariateStatistic getVarianceImpl ( ) { } public synchronized void setVarianceImpl ( UnivariateStatistic varianceImpl ) { } public synchronized UnivariateStatistic getSumsqImpl ( ) { } public synchronized void setSumsqImpl ( UnivariateStatistic sumsqImpl ) { } public synchronized UnivariateStatistic getSumImpl ( ) { } public synchronized void setSumImpl ( UnivariateStatistic sumImpl ) { } public DescriptiveStatistics copy ( ) { } public static void copy ( DescriptiveStatistics source , DescriptiveStatistics dest ) { } }

Fix:
StringBuilder outBuffer = new StringBuilder ( ) ;