Program: 21510
Project: 21510
Buggy source:
@Override public PluginStep getNextStep(Object parameter){
  DownloadLink downloadLink=(DownloadLink)parameter;
  PluginStep todo=null;
  if (currentStep == null) {
    try {
      requestInfo=getRequest(downloadLink.getUrlDownload());
      String newURL=getFirstMatch(requestInfo.getHtmlCode(),patternForNewHost,1);
      if (newURL != null) {
        newURL="String_Node_Str" + newURL.replaceAll("String_Node_Str","String_Node_Str");
        requestInfo=getRequest((new URL(newURL)),requestInfo.getCookie(),downloadLink.getName(),true);
        actionString="String_Node_Str" + getFirstMatch(requestInfo.getHtmlCode(),frameForCaptcha,1);
        requestInfo=getRequest((new URL(actionString)),requestInfo.getCookie(),newURL,true);
        System.out.println(requestInfo.getHtmlCode());
        captchaAddress="String_Node_Str" + getFirstMatch(requestInfo.getHtmlCode(),patternForCaptcha,1);
        System.out.println(captchaAddress);
        postTarget=getFormInputHidden(requestInfo.getHtmlCode());
      }
      currentStep=steps.firstElement();
      if (captchaAddress == null || postTarget == null) {
        downloadLink.setStatus(DownloadLink.STATUS_ERROR_UNKNOWN);
        currentStep.setStatus(PluginStep.STATUS_ERROR);
        logger.warning("String_Node_Str");
        return currentStep;
      }
    }
 catch (    MalformedURLException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
  int index=steps.indexOf(currentStep);
  todo=currentStep;
  if (index + 1 < steps.size())   currentStep=steps.get(index + 1);
  logger.finer(todo.toString());
switch (todo.getStep()) {
case PluginStep.STEP_WAIT_TIME:
    todo.setParameter(new Long(waitTime));
  break;
case PluginStep.STEP_CAPTCHA:
todo.setParameter(captchaAddress);
todo.setStatus(PluginStep.STATUS_USER_INPUT);
break;
case PluginStep.STEP_DOWNLOAD:
try {
requestInfo=postRequest((new URL(actionString)),requestInfo.getCookie(),actionString,postTarget + "String_Node_Str" + (String)steps.get(1).getParameter(),true);
postTarget=getFirstMatch(requestInfo.getHtmlCode(),patternForDownloadlink,1);
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
boolean success=prepareDownload(downloadLink);
if (success) {
todo.setStatus(PluginStep.STATUS_DONE);
downloadLink.setStatus(DownloadLink.STATUS_DONE);
return null;
}
 else {
logger.severe("String_Node_Str");
downloadLink.setStatus(DownloadLink.STATUS_ERROR_CAPTCHA_WRONG);
todo.setStatus(PluginStep.STATUS_ERROR);
}
break;
}
return todo;
}

Fixed version (ground truth):
@Override public PluginStep getNextStep(Object parameter){
  DownloadLink downloadLink=(DownloadLink)parameter;
  PluginStep todo=null;
  if (currentStep == null) {
    try {
      requestInfo=getRequest(downloadLink.getUrlDownload());
      String newURL=getFirstMatch(requestInfo.getHtmlCode(),patternForNewHost,1);
      if (newURL != null) {
        newURL="String_Node_Str" + newURL.replaceAll("String_Node_Str","String_Node_Str");
        requestInfo=getRequest((new URL(newURL)),null,downloadLink.getName(),true);
        actionString="String_Node_Str" + getFirstMatch(requestInfo.getHtmlCode(),frameForCaptcha,1);
        actionString=actionString.replaceAll("String_Node_Str","String_Node_Str");
        requestInfo=getRequest((new URL(actionString)),"String_Node_Str",newURL,true);
        captchaAddress="String_Node_Str" + getFirstMatch(requestInfo.getHtmlCode(),patternForCaptcha,1);
        captchaAddress=captchaAddress.replaceAll("String_Node_Str","String_Node_Str");
        postTarget=getFormInputHidden(requestInfo.getHtmlCode());
      }
      currentStep=steps.firstElement();
      if (captchaAddress == null || postTarget == null) {
        downloadLink.setStatus(DownloadLink.STATUS_ERROR_UNKNOWN);
        currentStep.setStatus(PluginStep.STATUS_ERROR);
        logger.warning("String_Node_Str");
        return currentStep;
      }
    }
 catch (    MalformedURLException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
  int index=steps.indexOf(currentStep);
  todo=currentStep;
  if (index + 1 < steps.size())   currentStep=steps.get(index + 1);
  logger.finer(todo.toString());
switch (todo.getStep()) {
case PluginStep.STEP_WAIT_TIME:
    todo.setParameter(new Long(waitTime));
  break;
case PluginStep.STEP_CAPTCHA:
todo.setParameter(captchaAddress);
todo.setStatus(PluginStep.STATUS_USER_INPUT);
break;
case PluginStep.STEP_DOWNLOAD:
try {
requestInfo=postRequest((new URL(actionString)),requestInfo.getCookie(),actionString,postTarget + "String_Node_Str" + (String)steps.get(1).getParameter(),true);
postTarget=getFirstMatch(requestInfo.getHtmlCode(),patternForDownloadlink,1);
postTarget=postTarget.replaceAll("String_Node_Str","String_Node_Str");
}
 catch (MalformedURLException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
boolean success=prepareDownload(downloadLink);
if (success) {
todo.setStatus(PluginStep.STATUS_DONE);
downloadLink.setStatus(DownloadLink.STATUS_DONE);
return null;
}
 else {
logger.severe("String_Node_Str");
downloadLink.setStatus(DownloadLink.STATUS_ERROR_CAPTCHA_WRONG);
todo.setStatus(PluginStep.STATUS_ERROR);
}
break;
}
return todo;
}