Program: 21496
Project: 21496
Buggy source:
public void run(){
  DownloadLink downloadLink;
  PluginForHost plugin;
  while ((downloadLink=controller.getNextDownloadLink()) != null) {
    logger.info("String_Node_Str" + downloadLink.getName());
    currentPlugin=plugin=(PluginForHost)downloadLink.getPlugin();
    plugin.resetPlugin();
    downloadLink.setStatusText("String_Node_Str");
    fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
    plugin.init();
    PluginStep step=plugin.doNextStep(downloadLink);
    fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_ACTIVE));
    while (!aborted && step != null && step.getStatus() != PluginStep.STATUS_ERROR) {
      logger.info("String_Node_Str" + step);
switch (step.getStep()) {
case PluginStep.STEP_GET_CAPTCHA_FILE:
        downloadLink.setStatusText("String_Node_Str");
      fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
    File captcha=null;
  if (step.getParameter() != null && step.getParameter() instanceof File) {
    captcha=(File)step.getParameter();
  }
if (captcha == null) {
  logger.severe("String_Node_Str");
  step.setParameter("String_Node_Str");
  step.setStatus(PluginStep.STATUS_ERROR);
  downloadLink.setStatus(DownloadLink.STATUS_ERROR_CAPTCHA_IMAGEERROR);
  break;
}
 else {
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_CAPTCHA_LOADED,captcha));
  downloadLink.setLatestCaptchaFile(captcha);
  if (plugin.doBotCheck(captcha)) {
    downloadLink.setStatus(DownloadLink.STATUS_ERROR_BOT_DETECTED);
    step.setStatus(PluginStep.STATUS_ERROR);
    step.setParameter(null);
    break;
  }
  if (!Interaction.handleInteraction((Interaction.INTERACTION_DOWNLOAD_CAPTCHA),downloadLink,0)) {
    String captchaText=JDUtilities.getCaptcha(controller,plugin,captcha);
    logger.info("String_Node_Str" + captchaText);
    downloadLink.setStatusText("String_Node_Str" + captchaText);
    fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
    step.setParameter(captchaText);
    step.setStatus(PluginStep.STATUS_DONE);
  }
 else {
    Interaction[] interacts=Interaction.getInteractions(Interaction.INTERACTION_DOWNLOAD_CAPTCHA);
    if (interacts.length > 0) {
      String captchaText=(String)interacts[0].getProperty("String_Node_Str");
      if (captchaText == null) {
        captchaText=JDUtilities.getCaptcha(controller,plugin,captcha);
      }
      logger.info("String_Node_Str" + captchaText);
      downloadLink.setStatusText("String_Node_Str" + captchaText);
      fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
      step.setParameter(captchaText);
      step.setStatus(PluginStep.STATUS_DONE);
    }
  }
}
break;
}
if (step != null && downloadLink != null && plugin != null && plugin.nextStep(step) != null) {
downloadLink.setStatusText(plugin.nextStep(step).toString());
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
}
if (step.getStatus() == PluginStep.STATUS_ERROR) {
break;
}
step=plugin.doNextStep(downloadLink);
}
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_INACTIVE));
if (aborted) {
downloadLink.setStatusText("String_Node_Str");
plugin.abort();
logger.warning("String_Node_Str");
downloadLink.setStatus(DownloadLink.STATUS_TODO);
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
try {
Thread.sleep(1000);
}
 catch (InterruptedException e) {
}
clearDownloadListStatus();
return;
}
if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_DOWNLOAD_LIMIT && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorWaittime(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_STATIC_WAITTIME && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorStaticWaittime(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_CAPTCHA_IMAGEERROR && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorCaptchaImage(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_FILE_ABUSED && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorAbused(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_FILE_NOT_FOUND && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorFileNotFound(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_CAPTCHA_WRONG && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorCaptcha(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_BOT_DETECTED && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorBotdetection(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_UNKNOWN_RETRY && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorRetry(downloadLink,plugin,step);
}
 else if (step != null && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorUnknown(downloadLink,plugin,step);
}
 else {
downloadLink.setStatusText("String_Node_Str");
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED,downloadLink));
Interaction.handleInteraction((Interaction.INTERACTION_DOWNLOAD_FINISHED),this);
}
}
this.waitForDownloadLinks();
}

Fixed version (ground truth):
public void run(){
  DownloadLink downloadLink;
  PluginForHost plugin;
  while ((downloadLink=controller.getNextDownloadLink()) != null) {
    logger.info("String_Node_Str" + downloadLink.getName());
    currentPlugin=plugin=(PluginForHost)downloadLink.getPlugin();
    plugin.resetPlugin();
    downloadLink.setStatusText("String_Node_Str");
    fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
    plugin.init();
    PluginStep step=plugin.doNextStep(downloadLink);
    fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_ACTIVE));
    while (!aborted && step != null && step.getStatus() != PluginStep.STATUS_ERROR) {
      logger.info("String_Node_Str" + step);
switch (step.getStep()) {
case PluginStep.STEP_GET_CAPTCHA_FILE:
        downloadLink.setStatusText("String_Node_Str");
      fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
    File captcha=null;
  if (step.getParameter() != null && step.getParameter() instanceof File) {
    captcha=(File)step.getParameter();
  }
if (captcha == null) {
  logger.severe("String_Node_Str");
  step.setParameter("String_Node_Str");
  step.setStatus(PluginStep.STATUS_ERROR);
  downloadLink.setStatus(DownloadLink.STATUS_ERROR_CAPTCHA_IMAGEERROR);
  break;
}
 else {
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_CAPTCHA_LOADED,captcha));
  downloadLink.setLatestCaptchaFile(captcha);
  if (plugin.doBotCheck(captcha)) {
    downloadLink.setStatus(DownloadLink.STATUS_ERROR_BOT_DETECTED);
    step.setStatus(PluginStep.STATUS_ERROR);
    step.setParameter(null);
    break;
  }
  if (!Interaction.handleInteraction((Interaction.INTERACTION_DOWNLOAD_CAPTCHA),downloadLink,0)) {
    String captchaText=JDUtilities.getCaptcha(controller,plugin,captcha);
    logger.info("String_Node_Str" + captchaText);
    downloadLink.setStatusText("String_Node_Str" + captchaText);
    fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
    step.setParameter(captchaText);
    step.setStatus(PluginStep.STATUS_DONE);
  }
 else {
    Interaction[] interacts=Interaction.getInteractions(Interaction.INTERACTION_DOWNLOAD_CAPTCHA);
    if (interacts.length > 0) {
      String captchaText=(String)interacts[0].getProperty("String_Node_Str");
      if (captchaText == null) {
        captchaText=JDUtilities.getCaptcha(controller,plugin,captcha);
      }
      logger.info("String_Node_Str" + captchaText);
      downloadLink.setStatusText("String_Node_Str" + captchaText);
      fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
      step.setParameter(captchaText);
      step.setStatus(PluginStep.STATUS_DONE);
    }
  }
}
break;
}
if (step != null && downloadLink != null && plugin != null && plugin.nextStep(step) != null) {
downloadLink.setStatusText(plugin.nextStep(step).toString());
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
}
if (step.getStatus() == PluginStep.STATUS_ERROR) {
break;
}
step=plugin.doNextStep(downloadLink);
}
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_INACTIVE));
if (aborted) {
downloadLink.setStatusText("String_Node_Str");
plugin.abort();
logger.warning("String_Node_Str");
downloadLink.setStatus(DownloadLink.STATUS_TODO);
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
try {
Thread.sleep(1000);
}
 catch (InterruptedException e) {
}
clearDownloadListStatus();
return;
}
if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_DOWNLOAD_LIMIT && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorWaittime(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_STATIC_WAITTIME && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorStaticWaittime(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_CAPTCHA_IMAGEERROR && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorCaptchaImage(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_FILE_ABUSED && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorAbused(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_FILE_NOT_FOUND && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorFileNotFound(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_CAPTCHA_WRONG && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorCaptcha(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_BOT_DETECTED && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorBotdetection(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_UNKNOWN_RETRY && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorRetry(downloadLink,plugin,step);
}
 else if (step != null && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorUnknown(downloadLink,plugin,step);
}
 else {
downloadLink.setStatusText("String_Node_Str");
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED));
Interaction.handleInteraction((Interaction.INTERACTION_DOWNLOAD_FINISHED),this);
}
}
this.waitForDownloadLinks();
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED));
Interaction.handleInteraction((Interaction.INTERACTION_DOWNLOADS_FINISHED_ALL),this);
}