Program: 21516
Project: 21516
Buggy source:
@Override public PluginStep getNextStep(Object parameter){
  DownloadLink downloadLink=(DownloadLink)parameter;
  RequestInfo requestInfo;
  PluginStep todo=null;
  if (currentStep == null) {
    try {
      requestInfo=getRequest(downloadLink.getUrlDownload());
      String newURL=getFirstMatch(requestInfo.getHtmlCode(),patternForNewHost,1);
      requestInfo=postRequest(new URL(newURL),"String_Node_Str");
      captchaAddress=getFirstMatch(requestInfo.getHtmlCode(),patternForCaptcha,1);
      postTarget=getFirstMatch(requestInfo.getHtmlCode(),patternForFormData,1);
      actionString=getFirstMatch(requestInfo.getHtmlCode(),patternForFormData,2);
      currentStep=steps.firstElement();
      if (captchaAddress == null || postTarget == null || actionString == null) {
        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.elementAt(index + 1);
  logger.info(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:
postParameter.put("String_Node_Str","String_Node_Str");
postParameter.put("String_Node_Str",(String)steps.elementAt(1).getParameter());
postParameter.put("String_Node_Str",actionString);
boolean success=prepareDownload(downloadLink);
if (success) todo.setStatus(PluginStep.STATUS_DONE);
 else todo.setStatus(PluginStep.STATUS_ERROR);
break;
}
return todo;
}

Fixed version (ground truth):
@Override public PluginStep getNextStep(Object parameter){
  DownloadLink downloadLink=(DownloadLink)parameter;
  RequestInfo requestInfo;
  PluginStep todo=null;
  if (currentStep == null) {
    try {
      requestInfo=getRequest(downloadLink.getUrlDownload());
      String newURL=getFirstMatch(requestInfo.getHtmlCode(),patternForNewHost,1);
      if (newURL != null) {
        requestInfo=postRequest(new URL(newURL),"String_Node_Str");
        captchaAddress=getFirstMatch(requestInfo.getHtmlCode(),patternForCaptcha,1);
        postTarget=getFirstMatch(requestInfo.getHtmlCode(),patternForFormData,1);
        actionString=getFirstMatch(requestInfo.getHtmlCode(),patternForFormData,2);
        currentStep=steps.firstElement();
      }
 else {
        logger.warning("String_Node_Str");
      }
      if (captchaAddress == null || postTarget == null || actionString == null) {
        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.elementAt(index + 1);
  logger.info(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:
postParameter.put("String_Node_Str","String_Node_Str");
postParameter.put("String_Node_Str",(String)steps.elementAt(1).getParameter());
postParameter.put("String_Node_Str",actionString);
boolean success=prepareDownload(downloadLink);
if (success) todo.setStatus(PluginStep.STATUS_DONE);
 else todo.setStatus(PluginStep.STATUS_ERROR);
break;
}
return todo;
}