Program: 141635
Project: 141635
Buggy source:
public void run(){
  final short buffer[]=new short[bufferSize];
  returnToPrev=false;
  do {
    fileName=queue.getFilename();
    if (!InfoCache.testModule(fileName)) {
      Log.w(TAG,fileName + "String_Node_Str");
      if (returnToPrev) {
        queue.previous();
      }
      continue;
    }
    Log.i(TAG,"String_Node_Str" + fileName);
    if (Xmp.loadModule(fileName) < 0) {
      Log.e(TAG,"String_Node_Str" + fileName);
      if (returnToPrev) {
        queue.previous();
      }
      continue;
    }
    returnToPrev=false;
    notifier.notification(Xmp.getModName(),queue.getIndex());
    isLoaded=true;
    for (int i=0; i < 64; i++) {
      Xmp.mute(i,0);
    }
    int numClients=callbacks.beginBroadcast();
    for (int j=0; j < numClients; j++) {
      try {
        callbacks.getBroadcastItem(j).newModCallback(fileName,Xmp.getInstruments());
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str");
      }
    }
    callbacks.finishBroadcast();
    final String volBoost=prefs.getString(Preferences.VOL_BOOST,"String_Node_Str");
    final int[] interpTypes={Xmp.XMP_INTERP_NEAREST,Xmp.XMP_INTERP_LINEAR,Xmp.XMP_INTERP_SPLINE};
    final int temp=Integer.parseInt(prefs.getString(Preferences.INTERP_TYPE,"String_Node_Str"));
    int interpType;
    if (temp >= 1 && temp <= 2) {
      interpType=interpTypes[temp];
    }
 else {
      interpType=Xmp.XMP_INTERP_LINEAR;
    }
    int dsp=0;
    if (prefs.getBoolean(Preferences.FILTER,true)) {
      dsp|=Xmp.XMP_DSP_LOWPASS;
    }
    if (!prefs.getBoolean(Preferences.INTERPOLATE,true)) {
      interpType=Xmp.XMP_INTERP_NEAREST;
    }
    audio.play();
    Xmp.startPlayer(0,sampleRate,sampleFormat);
    Xmp.setPlayer(Xmp.XMP_PLAYER_AMP,Integer.parseInt(volBoost));
    Xmp.setPlayer(Xmp.XMP_PLAYER_MIX,prefs.getInt(Preferences.PAN_SEPARATION,70));
    Xmp.setPlayer(Xmp.XMP_PLAYER_INTERP,interpType);
    Xmp.setPlayer(Xmp.XMP_PLAYER_DSP,dsp);
    updateData=true;
    int count;
    int loopCount=0;
    while (Xmp.playFrame() == 0) {
      count=Xmp.getLoopCount();
      if (!looped && count != loopCount) {
        break;
      }
      loopCount=count;
      final int size=Xmp.getBuffer(buffer);
      audio.write(buffer,0,size);
      while (paused) {
        audio.pause();
        watchdog.refresh();
        try {
          Thread.sleep(500);
          checkMediaButtons();
          checkNotificationButtons();
        }
 catch (        InterruptedException e) {
          break;
        }
      }
      audio.play();
      watchdog.refresh();
      checkMediaButtons();
      checkNotificationButtons();
    }
    Xmp.endPlayer();
    isLoaded=false;
    numClients=callbacks.beginBroadcast();
    for (int j=0; j < numClients; j++) {
      try {
        callbacks.getBroadcastItem(j).endModCallback();
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str");
      }
    }
    callbacks.finishBroadcast();
    Xmp.releaseModule();
    audio.stop();
    if (restartList) {
      queue.setIndex(startIndex - 1);
      restartList=false;
      continue;
    }
    if (returnToPrev) {
      queue.previous();
      continue;
    }
  }
 while (!stopPlaying && queue.next());
synchronized (this) {
    updateData=false;
  }
  watchdog.stop();
  notifier.cancel();
  end();
  stopSelf();
}

Fixed version (ground truth):
public void run(){
  final short buffer[]=new short[bufferSize];
  returnToPrev=false;
  do {
    fileName=queue.getFilename();
    if (!InfoCache.testModule(fileName)) {
      Log.w(TAG,fileName + "String_Node_Str");
      if (returnToPrev) {
        queue.previous();
      }
      continue;
    }
    Log.i(TAG,"String_Node_Str" + fileName);
    if (Xmp.loadModule(fileName) < 0) {
      Log.e(TAG,"String_Node_Str" + fileName);
      if (returnToPrev) {
        queue.previous();
      }
      continue;
    }
    returnToPrev=false;
    notifier.notification(Xmp.getModName(),queue.getIndex());
    isLoaded=true;
    for (int i=0; i < 64; i++) {
      Xmp.mute(i,0);
    }
    int numClients=callbacks.beginBroadcast();
    for (int j=0; j < numClients; j++) {
      try {
        callbacks.getBroadcastItem(j).newModCallback(fileName,Xmp.getInstruments());
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str");
      }
    }
    callbacks.finishBroadcast();
    final String volBoost=prefs.getString(Preferences.VOL_BOOST,"String_Node_Str");
    final int[] interpTypes={Xmp.XMP_INTERP_NEAREST,Xmp.XMP_INTERP_LINEAR,Xmp.XMP_INTERP_SPLINE};
    final int temp=Integer.parseInt(prefs.getString(Preferences.INTERP_TYPE,"String_Node_Str"));
    int interpType;
    if (temp >= 1 && temp <= 2) {
      interpType=interpTypes[temp];
    }
 else {
      interpType=Xmp.XMP_INTERP_LINEAR;
    }
    int dsp=0;
    if (prefs.getBoolean(Preferences.FILTER,true)) {
      dsp|=Xmp.XMP_DSP_LOWPASS;
    }
    if (!prefs.getBoolean(Preferences.INTERPOLATE,true)) {
      interpType=Xmp.XMP_INTERP_NEAREST;
    }
    audio.play();
    Xmp.startPlayer(0,sampleRate,sampleFormat);
    Xmp.setPlayer(Xmp.XMP_PLAYER_AMP,Integer.parseInt(volBoost));
    Xmp.setPlayer(Xmp.XMP_PLAYER_MIX,prefs.getInt(Preferences.PAN_SEPARATION,70));
    Xmp.setPlayer(Xmp.XMP_PLAYER_INTERP,interpType);
    Xmp.setPlayer(Xmp.XMP_PLAYER_DSP,dsp);
    updateData=true;
    int count;
    int loopCount=0;
    while (Xmp.playFrame() == 0) {
      count=Xmp.getLoopCount();
      if (!looped && count != loopCount) {
        break;
      }
      loopCount=count;
      final int size=Xmp.getBuffer(buffer);
      audio.write(buffer,0,size);
      while (paused) {
        audio.pause();
        watchdog.refresh();
        try {
          Thread.sleep(500);
          checkMediaButtons();
          checkNotificationButtons();
        }
 catch (        InterruptedException e) {
          break;
        }
      }
      audio.play();
      watchdog.refresh();
      checkMediaButtons();
      checkNotificationButtons();
    }
    Xmp.endPlayer();
    isLoaded=false;
    numClients=callbacks.beginBroadcast();
    for (int j=0; j < numClients; j++) {
      try {
        callbacks.getBroadcastItem(j).endModCallback();
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str");
      }
    }
    callbacks.finishBroadcast();
    Xmp.releaseModule();
    audio.stop();
    if (restartList) {
      queue.setIndex(startIndex - 1);
      restartList=false;
      continue;
    }
    if (returnToPrev) {
      queue.previous();
      continue;
    }
  }
 while (!stopPlaying && queue.next());
synchronized (this) {
    updateData=false;
  }
  watchdog.stop();
  notifier.cancel();
  end();
  Log.i(TAG,"String_Node_Str");
  stopSelf();
}