Program: 166859
Project: 166859
Buggy source:
private void handleTrack(final Intent intent){
  if (intent == null || !WAILSettings.isEnabled(this)) {
    Loggi.w("String_Node_Str");
    return;
  }
  final String player=intent.getStringExtra(CommonMusicAppReceiver.EXTRA_PLAYER_PACKAGE_NAME);
  if (ignoredPlayersDBHelper.contains(player)) {
    Loggi.w(String.format("String_Node_Str",player));
    return;
  }
  AsyncTaskExecutor.executeConcurrently(new AsyncTask<Void,Void,Void>(){
    @Override protected Void doInBackground(    Void... params){
      Loggi.i("String_Node_Str" + intent);
      mayBeCleanDB();
      final String extraAction=intent.getStringExtra(CommonMusicAppReceiver.EXTRA_ACTION);
      if (extraAction == null || extraAction.lastIndexOf('.') == -1) {
        Loggi.e("String_Node_Str");
        return null;
      }
      final boolean isCurrentTrackPlaying=intent.getBooleanExtra(CommonMusicAppReceiver.EXTRA_PLAYING,false);
      final Track currentTrack=CommonMusicAppReceiver.parseFromIntentExtras(intent);
      if (isCurrentTrackPlaying) {
        WAILSettings.setNowScrobblingTrack(getApplicationContext(),currentTrack);
        String applicationLabel=null;
        try {
          PackageManager packageManager=getApplication().getPackageManager();
          ApplicationInfo applicationInfo=packageManager.getApplicationInfo(player,0);
          applicationLabel=packageManager.getApplicationLabel(applicationInfo).toString();
        }
 catch (        PackageManager.NameNotFoundException e) {
          Loggi.w("String_Node_Str" + player);
        }
        WAILSettings.setNowScrobblingPlayerLabel(getApplicationContext(),applicationLabel);
        WAILSettings.setNowScrobblingPlayerPackageName(getApplicationContext(),player);
        StatusBarNotificationsManager.getInstance(getApplicationContext()).showTrackScrobblingStatusBarNotification(currentTrack);
        updateNowPlaying(currentTrack);
      }
 else {
        StatusBarNotificationsManager.getInstance(getApplicationContext()).hideTrackScrobblingStatusBarNotification();
        WAILSettings.setNowScrobblingTrack(getApplicationContext(),null);
        WAILSettings.setNowScrobblingPlayerPackageName(getApplicationContext(),null);
      }
      LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(new Intent(TracksDBHelper.INTENT_TRACKS_CHANGED));
      final LastCapturedTrackInfo mLastCapturedTrackInfo=WAILSettings.getLastCapturedTrackInfo(getApplicationContext());
      if (mLastCapturedTrackInfo == null) {
      }
 else {
        final long trackPlayingDurationInMillis=currentTrack.getTimestamp() - mLastCapturedTrackInfo.getTrack().getTimestamp();
        final long minTrackDurationInMillis=WAILSettings.getMinTrackDurationInSeconds(getApplicationContext()) * 1000;
        if ((!isCurrentTrackPlaying && mLastCapturedTrackInfo.isPlaying()) || mLastCapturedTrackInfo.isPlaying()) {
          if (trackPlayingDurationInMillis >= minTrackDurationInMillis) {
            Loggi.w("String_Node_Str" + trackPlayingDurationInMillis + "String_Node_Str"+ (WAILSettings.getMinTrackDurationInSeconds(getApplicationContext()) * 1000));
            long duration=mLastCapturedTrackInfo.getTrack().getDurationInMillis();
            if (duration != -1) {
              final int trackDurationInPercents=(int)(100 * trackPlayingDurationInMillis / (duration + 2500));
              int minTrackDurationInPercents=WAILSettings.getMinTrackDurationInPercents(getApplicationContext());
              if (trackDurationInPercents >= minTrackDurationInPercents) {
                Loggi.w("String_Node_Str" + trackPlayingDurationInMillis + "String_Node_Str"+ trackDurationInPercents+ "String_Node_Str"+ minTrackDurationInPercents);
                mLastCapturedTrackInfo.getTrack().setStateTimestamp(System.currentTimeMillis());
                addTrackToDB(mLastCapturedTrackInfo.getTrack());
              }
 else {
                Loggi.w("String_Node_Str" + trackPlayingDurationInMillis + "String_Node_Str"+ trackDurationInPercents+ "String_Node_Str"+ minTrackDurationInPercents);
                SoundNotificationsManager.getInstance(getApplicationContext()).playTrackSkippedSound();
              }
            }
 else {
              Loggi.w("String_Node_Str" + trackPlayingDurationInMillis + "String_Node_Str"+ minTrackDurationInMillis+ "String_Node_Str");
            }
          }
 else {
            mLastCapturedTrackInfo.getTrack().setStateTimestamp(System.currentTimeMillis());
            addTrackToDB(mLastCapturedTrackInfo.getTrack());
          }
        }
 else {
          Loggi.w("String_Node_Str");
        }
      }
      WAILSettings.setLastCapturedTrackInfo(getApplicationContext(),new LastCapturedTrackInfo(currentTrack,isCurrentTrackPlaying));
      return null;
    }
    @Override protected void onPostExecute(    Void aVoid){
      scrobblePendingTracks(false);
    }
  }
);
}

Fixed version (ground truth):
private void handleTrack(final Intent intent){
  if (intent == null || !WAILSettings.isEnabled(this)) {
    Loggi.w("String_Node_Str");
    return;
  }
  final String player=intent.getStringExtra(CommonMusicAppReceiver.EXTRA_PLAYER_PACKAGE_NAME);
  if (ignoredPlayersDBHelper.contains(player)) {
    Loggi.w(String.format("String_Node_Str",player));
    return;
  }
  AsyncTaskExecutor.executeConcurrently(new AsyncTask<Void,Void,Void>(){
    @Override protected Void doInBackground(    Void... params){
      Loggi.i("String_Node_Str" + intent);
      mayBeCleanDB();
      final String extraAction=intent.getStringExtra(CommonMusicAppReceiver.EXTRA_ACTION);
      if (extraAction == null || extraAction.lastIndexOf('.') == -1) {
        Loggi.e("String_Node_Str");
        return null;
      }
      final boolean isCurrentTrackPlaying=intent.getBooleanExtra(CommonMusicAppReceiver.EXTRA_PLAYING,false);
      final Track currentTrack=CommonMusicAppReceiver.parseFromIntentExtras(intent);
      if (isCurrentTrackPlaying) {
        WAILSettings.setNowScrobblingTrack(getApplicationContext(),currentTrack);
        String applicationLabel=null;
        try {
          PackageManager packageManager=getApplication().getPackageManager();
          ApplicationInfo applicationInfo=packageManager.getApplicationInfo(player,0);
          applicationLabel=packageManager.getApplicationLabel(applicationInfo).toString();
        }
 catch (        PackageManager.NameNotFoundException e) {
          Loggi.w("String_Node_Str" + player);
        }
        WAILSettings.setNowScrobblingPlayerLabel(getApplicationContext(),applicationLabel);
        WAILSettings.setNowScrobblingPlayerPackageName(getApplicationContext(),player);
        StatusBarNotificationsManager.getInstance(getApplicationContext()).showTrackScrobblingStatusBarNotification(currentTrack);
        updateNowPlaying(currentTrack);
      }
 else {
        StatusBarNotificationsManager.getInstance(getApplicationContext()).hideTrackScrobblingStatusBarNotification();
        WAILSettings.setNowScrobblingTrack(getApplicationContext(),null);
        WAILSettings.setNowScrobblingPlayerPackageName(getApplicationContext(),null);
      }
      LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(new Intent(TracksDBHelper.INTENT_TRACKS_CHANGED));
      final LastCapturedTrackInfo mLastCapturedTrackInfo=WAILSettings.getLastCapturedTrackInfo(getApplicationContext());
      if (mLastCapturedTrackInfo == null) {
      }
 else {
        final long trackPlayingDurationInMillis=currentTrack.getTimestamp() - mLastCapturedTrackInfo.getTrack().getTimestamp();
        final long minTrackDurationInMillis=WAILSettings.getMinTrackDurationInSeconds(getApplicationContext()) * 1000;
        if ((!isCurrentTrackPlaying && mLastCapturedTrackInfo.isPlaying()) || mLastCapturedTrackInfo.isPlaying()) {
          Loggi.w("String_Node_Str" + trackPlayingDurationInMillis + "String_Node_Str"+ (WAILSettings.getMinTrackDurationInSeconds(getApplicationContext()) * 1000));
          long duration=mLastCapturedTrackInfo.getTrack().getDurationInMillis();
          if (duration != -1) {
            final int trackDurationInPercents=(int)(100 * trackPlayingDurationInMillis / (duration + 2500));
            int minTrackDurationInPercents=WAILSettings.getMinTrackDurationInPercents(getApplicationContext());
            if (trackDurationInPercents >= minTrackDurationInPercents) {
              Loggi.w("String_Node_Str" + trackPlayingDurationInMillis + "String_Node_Str"+ trackDurationInPercents+ "String_Node_Str"+ minTrackDurationInPercents);
              mLastCapturedTrackInfo.getTrack().setStateTimestamp(System.currentTimeMillis());
              addTrackToDB(mLastCapturedTrackInfo.getTrack());
            }
 else {
              Loggi.w("String_Node_Str" + trackPlayingDurationInMillis + "String_Node_Str"+ trackDurationInPercents+ "String_Node_Str"+ minTrackDurationInPercents);
              SoundNotificationsManager.getInstance(getApplicationContext()).playTrackSkippedSound();
            }
          }
 else {
            Loggi.w("String_Node_Str" + trackPlayingDurationInMillis + "String_Node_Str"+ minTrackDurationInMillis+ "String_Node_Str");
          }
        }
 else {
          Loggi.w("String_Node_Str");
        }
      }
      WAILSettings.setLastCapturedTrackInfo(getApplicationContext(),new LastCapturedTrackInfo(currentTrack,isCurrentTrackPlaying));
      return null;
    }
    @Override protected void onPostExecute(    Void aVoid){
      scrobblePendingTracks(false);
    }
  }
);
}