Program: 81351
Project: 81351
Buggy source:
public Sound transform(AbstractFrequencySoundTransformation st,Sound sound){
  Sound output=st.initSound(sound);
  double freqmax=sound.getSampleRate();
  double threshold=st.getLowThreshold(freqmax);
  int maxlength=st.getWindowLength(freqmax);
  long[] data=sound.getSamples();
  long[] newdata=output.getSamples();
  double[] transformeddata=new double[maxlength];
  FastFourierTransformer fastFourierTransformer=new FastFourierTransformer(DftNormalization.STANDARD);
  long maxValue=0;
  long minValue=Long.MAX_VALUE;
  for (int i=0; i < data.length; i+=threshold) {
    int length=Math.min(maxlength,data.length - i);
    for (int j=i; j < i + length; j++) {
      if (j - i < threshold) {
        if (maxValue < data[j]) {
          maxValue=data[j];
        }
        if (minValue > data[j]) {
          minValue=data[j];
        }
      }
      transformeddata[j - i]=data[j];
    }
    Complex[] complexArray=fastFourierTransformer.transform(transformeddata,TransformType.FORWARD);
    Spectrum fs=new Spectrum(complexArray,(int)freqmax,sound.getNbBytesPerSample());
    Spectrum result=st.transformFrequencies(fs,i,maxlength,length,Math.abs(maxValue - minValue) > Math.pow(256,sound.getNbBytesPerSample()) / 5);
    if (result == null) {
      continue;
    }
    complexArray=fastFourierTransformer.transform(result.getState(),TransformType.INVERSE);
    int k=st.getOffsetFromASimpleLoop(i,freqmax);
    for (int j=0; j < freqmax; j++) {
      if (i + j + k < newdata.length && newdata[i + j + k] == 0) {
        newdata[i + j + k]=(long)Math.floor(complexArray[j].getReal());
      }
    }
  }
  return output;
}

Fixed version (ground truth):
public Sound transform(AbstractFrequencySoundTransformation st,Sound sound){
  Sound output=st.initSound(sound);
  double freqmax=sound.getSampleRate();
  double threshold=st.getLowThreshold(freqmax);
  int maxlength=st.getWindowLength(freqmax);
  long[] data=sound.getSamples();
  long[] newdata=output.getSamples();
  double[] transformeddata=new double[maxlength];
  FastFourierTransformer fastFourierTransformer=new FastFourierTransformer(DftNormalization.STANDARD);
  for (int i=0; i < data.length; i+=threshold) {
    long maxValue=0;
    long minValue=Long.MAX_VALUE;
    int length=Math.min(maxlength,data.length - i);
    for (int j=i; j < i + length; j++) {
      if (j - i < threshold) {
        if (maxValue < data[j]) {
          maxValue=data[j];
        }
        if (minValue > data[j]) {
          minValue=data[j];
        }
      }
      transformeddata[j - i]=data[j];
    }
    Complex[] complexArray=fastFourierTransformer.transform(transformeddata,TransformType.FORWARD);
    Spectrum fs=new Spectrum(complexArray,(int)freqmax,sound.getNbBytesPerSample());
    Spectrum result=st.transformFrequencies(fs,i,maxlength,length,Math.abs(maxValue - minValue) > Math.pow(256,sound.getNbBytesPerSample()) / 6);
    if (result == null) {
      continue;
    }
    complexArray=fastFourierTransformer.transform(result.getState(),TransformType.INVERSE);
    int k=st.getOffsetFromASimpleLoop(i,freqmax);
    for (int j=0; j < freqmax; j++) {
      if (i + j + k < newdata.length && newdata[i + j + k] == 0) {
        newdata[i + j + k]=(long)Math.floor(complexArray[j].getReal());
      }
    }
  }
  return output;
}