Program: 21474
Project: 21474
Buggy source:
public void run(){
  PluginForHost plugin;
  logger.info("String_Node_Str" + downloadLink.getName());
  currentPlugin=plugin=(PluginForHost)downloadLink.getPlugin();
  plugin.resetPlugin();
  downloadLink.setStatusText("String_Node_Str");
  downloadLink.setInProgress(true);
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED,downloadLink));
  plugin.init();
  PluginStep step=plugin.doNextStep(downloadLink);
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_ACTIVE,plugin));
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_STARTS,downloadLink));
  while (!aborted && step != null && step.getStatus() != PluginStep.STATUS_ERROR) {
    logger.info("String_Node_Str" + step);
switch (step.getStep()) {
case PluginStep.STEP_PENDING:
      long wait=(Long)step.getParameter();
    logger.info("String_Node_Str" + wait);
  while (wait > 0 && !aborted) {
    downloadLink.setStatusText("String_Node_Str" + JDUtilities.formatSeconds((int)(wait / 1000)));
    fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED,downloadLink));
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException e) {
    }
    wait-=1000;
  }
break;
case PluginStep.STEP_GET_CAPTCHA_FILE:
downloadLink.setStatusText("String_Node_Str");
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED,downloadLink));
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,downloadLink));
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,downloadLink));
step.setParameter(captchaText);
step.setStatus(PluginStep.STATUS_DONE);
}
}
}
break;
}
if (aborted) {
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,downloadLink));
}
if (step.getStatus() == PluginStep.STATUS_ERROR) {
break;
}
step=plugin.doNextStep(downloadLink);
}
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,downloadLink));
try {
Thread.sleep(1000);
}
 catch (InterruptedException e) {
}
downloadLink.setInProgress(false);
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_INACTIVE,plugin));
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_TEMPORARILY_UNAVAILABLE && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorTemporarilyUnavailable(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 && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_PREMIUM && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorPremium(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_PREMIUM_LOGIN && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorPremiumLogin(downloadLink,plugin,step);
}
 else if (step != null && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorUnknown(downloadLink,plugin,step);
}
 else {
downloadLink.setStatusText("String_Node_Str");
downloadLink.setInProgress(false);
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED,downloadLink));
Interaction.handleInteraction((Interaction.INTERACTION_SINGLE_DOWNLOAD_FINISHED),downloadLink);
}
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_INACTIVE,plugin));
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_FINISHED,downloadLink));
}

Fixed version (ground truth):
public void run(){
  PluginForHost plugin;
  logger.info("String_Node_Str" + downloadLink.getName());
  currentPlugin=plugin=(PluginForHost)downloadLink.getPlugin();
  plugin.resetPlugin();
  downloadLink.setStatusText("String_Node_Str");
  downloadLink.setInProgress(true);
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED,downloadLink));
  plugin.init();
  PluginStep step=plugin.doNextStep(downloadLink);
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_ACTIVE,plugin));
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_STARTS,downloadLink));
  while (!aborted && step != null && step.getStatus() != PluginStep.STATUS_ERROR) {
    logger.info("String_Node_Str" + step);
    downloadLink.setStatusText("String_Node_Str");
switch (step.getStep()) {
case PluginStep.STEP_PENDING:
      long wait=(Long)step.getParameter();
    logger.info("String_Node_Str" + wait);
  while (wait > 0 && !aborted) {
    downloadLink.setStatusText("String_Node_Str" + JDUtilities.formatSeconds((int)(wait / 1000)));
    fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED,downloadLink));
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException e) {
    }
    wait-=1000;
  }
break;
case PluginStep.STEP_GET_CAPTCHA_FILE:
downloadLink.setStatusText("String_Node_Str");
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED,downloadLink));
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,downloadLink));
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,downloadLink));
step.setParameter(captchaText);
step.setStatus(PluginStep.STATUS_DONE);
}
}
}
break;
}
if (aborted) {
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,downloadLink));
}
if (step.getStatus() == PluginStep.STATUS_ERROR) {
break;
}
step=plugin.doNextStep(downloadLink);
}
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,downloadLink));
try {
Thread.sleep(1000);
}
 catch (InterruptedException e) {
}
downloadLink.setInProgress(false);
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_INACTIVE,plugin));
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_TEMPORARILY_UNAVAILABLE && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorTemporarilyUnavailable(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 && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_PREMIUM && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorPremium(downloadLink,plugin,step);
}
 else if (step != null && downloadLink.getStatus() == DownloadLink.STATUS_ERROR_PREMIUM_LOGIN && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorPremiumLogin(downloadLink,plugin,step);
}
 else if (step != null && step.getStatus() == PluginStep.STATUS_ERROR) {
this.onErrorUnknown(downloadLink,plugin,step);
}
 else {
downloadLink.setStatusText("String_Node_Str");
downloadLink.setInProgress(false);
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_CHANGED,downloadLink));
Interaction.handleInteraction((Interaction.INTERACTION_SINGLE_DOWNLOAD_FINISHED),downloadLink);
}
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_PLUGIN_HOST_INACTIVE,plugin));
fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SINGLE_DOWNLOAD_FINISHED,downloadLink));
}