Program: 39220
Project: 39220
Buggy source:
/** 
 * Method that inputs the format of an AudioInputStream as well as the byte array formed from its contents and then creates an array of ints containing the amplitude data of the stream. 
 * @param format AudioFormat of AudioinputStream
 * @param audioBytes byte array formed based on the size of the stream
 * @return int array containing amplitude data from stream
 */
private static int[] extractAmplitudeDataFromAmplitudeByteArray(AudioFormat format,byte[] audioBytes){
  int[] audioData=null;
  if (format.getSampleSizeInBits() == 16) {
    System.out.println("String_Node_Str");
    int nlengthInSamples=audioBytes.length / 2;
    audioData=new int[nlengthInSamples];
    if (format.isBigEndian()) {
      System.out.println("String_Node_Str");
      for (int i=0; i < nlengthInSamples; i++) {
        int MSB=audioBytes[2 * i];
        int LSB=audioBytes[2 * i + 1];
        audioData[i]=(MSB << 8 | (255 & LSB));
      }
    }
 else {
      System.out.println("String_Node_Str");
      for (int i=0; i < nlengthInSamples; i++) {
        int LSB=audioBytes[2 * i];
        int MSB=audioBytes[2 * i + 1];
        audioData[i]=(MSB << 8 | (255 & LSB));
      }
    }
  }
 else   if (format.getSampleSizeInBits() == 8) {
    int nlengthInSamples=audioBytes.length;
    audioData=new int[nlengthInSamples];
    if (format.getEncoding().toString().startsWith("String_Node_Str")) {
      for (int i=0; i < audioBytes.length; i++) {
        audioData[i]=audioBytes[i];
      }
    }
 else {
      for (int i=0; i < audioBytes.length; i++) {
        audioData[i]=audioBytes[i] - 128;
      }
    }
  }
  return audioData;
}

Fixed version (ground truth):
/** 
 * Method that inputs the format of an AudioInputStream as well as the byte array formed from its contents and then creates an array of ints containing the amplitude data of the stream. 
 * @param format AudioFormat of AudioinputStream
 * @param audioBytes byte array formed based on the size of the stream
 * @return int array containing amplitude data from stream
 */
public static int[] extractAmplitudeDataFromAmplitudeByteArray(AudioFormat format,byte[] audioBytes){
  int[] audioData=null;
  if (format.getSampleSizeInBits() == 16) {
    System.out.println("String_Node_Str");
    int nlengthInSamples=audioBytes.length / 2;
    audioData=new int[nlengthInSamples];
    if (format.isBigEndian()) {
      System.out.println("String_Node_Str");
      for (int i=0; i < nlengthInSamples; i++) {
        int MSB=audioBytes[2 * i];
        int LSB=audioBytes[2 * i + 1];
        audioData[i]=(MSB << 8 | (255 & LSB));
      }
    }
 else {
      System.out.println("String_Node_Str");
      for (int i=0; i < nlengthInSamples; i++) {
        int LSB=audioBytes[2 * i];
        int MSB=audioBytes[2 * i + 1];
        audioData[i]=(MSB << 8 | (255 & LSB));
      }
    }
  }
 else   if (format.getSampleSizeInBits() == 8) {
    int nlengthInSamples=audioBytes.length;
    audioData=new int[nlengthInSamples];
    if (format.getEncoding().toString().startsWith("String_Node_Str")) {
      for (int i=0; i < audioBytes.length; i++) {
        audioData[i]=audioBytes[i];
      }
    }
 else {
      for (int i=0; i < audioBytes.length; i++) {
        audioData[i]=audioBytes[i] - 128;
      }
    }
  }
  return audioData;
}