Program: 81374
Project: 81374
Buggy source:
public static String fsToString(FrequenciesState fs,int low,int high){
  float lastFrequency=(float)high;
  int length=(int)lastFrequency / 20;
  int height=15;
  int maxIndex=FrequenciesHelper.getMaxIndex(fs,low,high);
  long maxMagn=(long)fs.getState()[maxIndex].abs();
  StringBuffer sb=new StringBuffer();
  int step=(int)lastFrequency / length;
  int[] valuesOnPlot=new int[length];
  int maxPlotIndex=0;
  int maxPlotValue=0;
  double peakIndex=0;
  double peakValue=0;
  double minValuePlotted=-1;
  for (int i=0; i < valuesOnPlot.length; i++) {
    double maxValue=0;
    for (int j=0; j < step; j++) {
      if (peakValue * 2 < fs.getState()[i * step + j + low].abs()) {
        peakValue=fs.getState()[i * step + j + low].abs();
        peakIndex=i * step + j + low;
      }
      if (maxValue < fs.getState()[i * step + j + low].abs()) {
        maxValue=fs.getState()[i * step + j + low].abs();
      }
    }
    if (minValuePlotted == -1 || minValuePlotted > maxValue) {
      minValuePlotted=maxValue;
    }
    valuesOnPlot[i]=(int)(maxValue * height / (maxMagn));
    if (maxPlotValue < valuesOnPlot[i]) {
      maxPlotValue=valuesOnPlot[i];
      maxPlotIndex=i;
    }
  }
  for (int i=0; i < valuesOnPlot.length; i++) {
    valuesOnPlot[i]-=minValuePlotted * height / maxMagn;
  }
  for (int j=height; j >= 0; j--) {
    if (j == height) {
      sb.append("String_Node_Str" + maxMagn + "String_Node_Str");
      continue;
    }
 else {
      sb.append("String_Node_Str");
    }
    for (int i=0; i < length; i++) {
      if (valuesOnPlot[i] == j) {
        sb.append("String_Node_Str");
      }
 else       if (valuesOnPlot[i] > j) {
        sb.append("String_Node_Str");
      }
 else {
        sb.append("String_Node_Str");
      }
    }
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  for (int i=0; i < length; i++) {
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str" + lastFrequency + "String_Node_Str");
  sb.append("String_Node_Str" + (int)(maxPlotIndex * 1.0 / length * lastFrequency + low) + "String_Node_Str"+ (int)((maxPlotIndex + 1.0) / length * lastFrequency + low)+ "String_Node_Str");
  sb.append("String_Node_Str" + (int)(peakIndex - 10) + "String_Node_Str"+ (int)(peakIndex + 10)+ "String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public static String fsToString(FrequenciesState fs,int low,int high){
  float lastFrequency=(fs.getState().length < high ? fs.getState().length : (float)high);
  int length=(int)lastFrequency / 20;
  int height=15;
  int maxIndex=FrequenciesHelper.getMaxIndex(fs,low,high);
  long maxMagn=(long)fs.getState()[maxIndex].abs();
  StringBuffer sb=new StringBuffer();
  int step=(int)lastFrequency / length;
  int[] valuesOnPlot=new int[length];
  int maxPlotIndex=0;
  int maxPlotValue=0;
  double peakIndex=0;
  double peakValue=0;
  double minValuePlotted=-1;
  for (int i=0; i < valuesOnPlot.length; i++) {
    double maxValue=0;
    for (int j=0; j < step; j++) {
      int x=i * step + j + low;
      if (x < fs.getState().length && peakValue * 2 < fs.getState()[x].abs()) {
        peakValue=fs.getState()[x].abs();
        peakIndex=x;
      }
      if (x < fs.getState().length && maxValue < fs.getState()[x].abs()) {
        maxValue=fs.getState()[x].abs();
      }
    }
    if (minValuePlotted == -1 || minValuePlotted > maxValue) {
      minValuePlotted=maxValue;
    }
    valuesOnPlot[i]=(int)(maxValue * height / (maxMagn));
    if (maxPlotValue < valuesOnPlot[i]) {
      maxPlotValue=valuesOnPlot[i];
      maxPlotIndex=i;
    }
  }
  for (int i=0; i < valuesOnPlot.length; i++) {
    valuesOnPlot[i]-=minValuePlotted * height / maxMagn;
  }
  for (int j=height; j >= 0; j--) {
    if (j == height) {
      sb.append("String_Node_Str" + maxMagn + "String_Node_Str");
      continue;
    }
 else {
      sb.append("String_Node_Str");
    }
    for (int i=0; i < length; i++) {
      if (valuesOnPlot[i] == j) {
        sb.append("String_Node_Str");
      }
 else       if (valuesOnPlot[i] > j) {
        sb.append("String_Node_Str");
      }
 else {
        sb.append("String_Node_Str");
      }
    }
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  for (int i=0; i < length; i++) {
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str" + lastFrequency + "String_Node_Str");
  sb.append("String_Node_Str" + (int)(maxPlotIndex * 1.0 / length * lastFrequency + low) + "String_Node_Str"+ (int)((maxPlotIndex + 1.0) / length * lastFrequency + low)+ "String_Node_Str");
  sb.append("String_Node_Str" + (int)(peakIndex - 10) + "String_Node_Str"+ (int)(peakIndex + 10)+ "String_Node_Str");
  return sb.toString();
}