Program: 21358
Project: 21358
Buggy source:
@Override public boolean doInteraction(Object arg){
  Configuration configuration=JDUtilities.getConfiguration();
  String script=configuration.getStringProperty(Configuration.PARAM_HTTPSEND_REQUESTS);
  String user=configuration.getStringProperty(Configuration.PARAM_HTTPSEND_USER);
  String pass=configuration.getStringProperty(Configuration.PARAM_HTTPSEND_PASS);
  String ip=configuration.getStringProperty(Configuration.PARAM_HTTPSEND_IP);
  retries++;
  logger.info("String_Node_Str" + retries);
  ProgressController progress=new ProgressController(JDLocale.L("String_Node_Str","String_Node_Str"),10);
  progress.setStatusText(JDLocale.L("String_Node_Str","String_Node_Str" + retries));
  if (user != null || pass != null)   Authenticator.setDefault(new InternalAuthenticator(user,pass));
  if (script == null) {
    progress.finalize();
    return parseError("String_Node_Str");
  }
  String preIp=JDUtilities.getIPAddress();
  logger.finer("String_Node_Str" + preIp);
  progress.setStatusText(JDLocale.L("String_Node_Str","String_Node_Str") + preIp);
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  Document xmlScript;
  variables=new HashMap<String,String>();
  variables.put("String_Node_Str",user);
  variables.put("String_Node_Str",pass);
  variables.put("String_Node_Str",new BASE64Encoder().encode((user + "String_Node_Str" + pass).getBytes()));
  variables.put("String_Node_Str",ip);
  headerProperties=new HashMap<String,String>();
  progress.increase(1);
  try {
    xmlScript=parseXmlString(script,false);
    Node root=xmlScript.getChildNodes().item(0);
    if (root == null || !root.getNodeName().equalsIgnoreCase("String_Node_Str")) {
      progress.finalize();
      return parseError("String_Node_Str");
    }
    RequestInfo requestInfo=null;
    NodeList steps=root.getChildNodes();
    progress.addToMax(steps.getLength());
    for (int step=0; step < steps.getLength(); step++) {
      progress.setStatusText(JDLocale.L("String_Node_Str","String_Node_Str") + step);
      progress.increase(1);
      Node current=steps.item(step);
      if (current.getNodeType() == 3) {
        continue;
      }
      if (!current.getNodeName().equalsIgnoreCase("String_Node_Str")) {
        progress.finalize();
        return parseError("String_Node_Str" + current.getNodeName());
      }
      NodeList toDos=current.getChildNodes();
      for (int toDoStep=0; toDoStep < toDos.getLength(); toDoStep++) {
        Node toDo=toDos.item(toDoStep);
        progress.setStatusText(JDUtilities.sprintf(JDLocale.L("String_Node_Str","String_Node_Str"),new String[]{toDo.getNodeName()}));
        if (toDo.getNodeName().equalsIgnoreCase("String_Node_Str")) {
          NamedNodeMap attributes=toDo.getAttributes();
          for (int attribute=0; attribute < attributes.getLength(); attribute++) {
            String key=attributes.item(attribute).getNodeName();
            String value=attributes.item(attribute).getNodeValue();
            String[] tmp=value.split("String_Node_Str");
            ArrayList<String> params=Plugin.getAllSimpleMatches(value,"String_Node_Str",1);
            if (params.size() > 0) {
              String req;
              if (value.startsWith(params.get(0))) {
                req="String_Node_Str";
                logger.finer("String_Node_Str" + this.variables);
                logger.finer("String_Node_Str" + this.headerProperties);
                for (int i=0; i <= tmp.length; i++) {
                  logger.finer("String_Node_Str" + params.get(i - 1) + "String_Node_Str");
                  req+=getModifiedVariable(params.get(i - 1));
                  if (i < tmp.length) {
                    req+=tmp[i];
                  }
                }
              }
 else {
                req=tmp[0];
                logger.finer("String_Node_Str" + this.variables);
                logger.finer("String_Node_Str" + this.headerProperties);
                for (int i=1; i <= tmp.length; i++) {
                  if (i > params.size())                   continue;
                  logger.finer("String_Node_Str" + params.get(i - 1) + "String_Node_Str");
                  req+=getModifiedVariable(params.get(i - 1));
                  if (i < tmp.length) {
                    req+=tmp[i];
                  }
                }
              }
              value=req;
            }
            variables.put(key,value);
          }
          logger.finer("String_Node_Str" + variables);
        }
        if (toDo.getNodeName().equalsIgnoreCase("String_Node_Str")) {
          if (toDo.getChildNodes().getLength() != 1) {
            progress.finalize();
            return parseError("String_Node_Str");
          }
          requestInfo=doRequest(toDo.getChildNodes().item(0).getNodeValue().trim());
          if (requestInfo == null) {
            logger.severe("String_Node_Str" + toDo.getChildNodes().item(0).getNodeValue().trim());
          }
        }
        if (toDo.getNodeName().equalsIgnoreCase("String_Node_Str")) {
          logger.finer("String_Node_Str");
          if (toDo.getChildNodes().getLength() != 1) {
            progress.finalize();
            return parseError("String_Node_Str");
          }
          NamedNodeMap attributes=toDo.getAttributes();
          if (attributes.getNamedItem("String_Node_Str") == null) {
            progress.finalize();
            return parseError("String_Node_Str" + toDo);
          }
          String[] keys=attributes.getNamedItem("String_Node_Str").getNodeValue().split("String_Node_Str");
          getVariables(toDo.getChildNodes().item(0).getNodeValue().trim(),keys,requestInfo);
        }
        if (toDo.getNodeName().equalsIgnoreCase("String_Node_Str")) {
          NamedNodeMap attributes=toDo.getAttributes();
          Node item=attributes.getNamedItem("String_Node_Str");
          logger.finer("String_Node_Str" + item.getNodeValue() + "String_Node_Str");
          if (item == null) {
            return parseError("String_Node_Str");
          }
          int seconds=JDUtilities.filterInt(item.getNodeValue());
          Thread.sleep(seconds * 1000);
        }
      }
    }
  }
 catch (  SAXException e) {
    progress.finalize();
    return this.parseError(e.getMessage());
  }
catch (  ParserConfigurationException e) {
    e.printStackTrace();
    progress.finalize();
    return this.parseError(e.getMessage());
  }
catch (  Exception e) {
    e.printStackTrace();
    progress.finalize();
    return this.parseError(e.getCause() + "String_Node_Str" + e.getMessage());
  }
  int waittime=configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_IPCHECKWAITTIME,0);
  int maxretries=configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_RETRIES,0);
  int waitForIp=configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_WAITFORIPCHANGE,10);
  logger.finer("String_Node_Str" + waittime + "String_Node_Str");
  progress.increase(1);
  progress.setStatusText(JDLocale.L("String_Node_Str","String_Node_Str"));
  try {
    Thread.sleep(waittime * 1000);
  }
 catch (  InterruptedException e) {
  }
  String afterIP=JDUtilities.getIPAddress();
  logger.finer("String_Node_Str" + afterIP);
  progress.increase(1);
  String pattern=JDLocale.L("String_Node_Str","String_Node_Str");
  progress.setStatusText(JDUtilities.sprintf(pattern,new String[]{preIp,afterIP}));
  long endTime=System.currentTimeMillis() + waitForIp * 1000;
  while (System.currentTimeMillis() <= endTime && (afterIP.equalsIgnoreCase("String_Node_Str") || afterIP == null || afterIP.equals(preIp))) {
    try {
      Thread.sleep(5 * 1000);
    }
 catch (    InterruptedException e) {
    }
    afterIP=JDUtilities.getIPAddress();
    pattern=JDLocale.L("String_Node_Str","String_Node_Str");
    progress.setStatusText(JDUtilities.sprintf(pattern,new String[]{preIp,afterIP}));
    logger.finer("String_Node_Str" + afterIP);
  }
  if (!afterIP.equals(preIp) && !afterIP.equalsIgnoreCase("String_Node_Str")) {
    progress.finalize();
    logger.info("String_Node_Str" + afterIP);
    return true;
  }
  if (retries <= maxretries) {
    progress.finalize();
    return doInteraction(arg);
  }
  progress.finalize();
  logger.info("String_Node_Str" + afterIP);
  return false;
}

Fixed version (ground truth):
@Override public boolean doInteraction(Object arg){
  Configuration configuration=JDUtilities.getConfiguration();
  String script=configuration.getStringProperty(Configuration.PARAM_HTTPSEND_REQUESTS);
  String user=configuration.getStringProperty(Configuration.PARAM_HTTPSEND_USER);
  String pass=configuration.getStringProperty(Configuration.PARAM_HTTPSEND_PASS);
  String ip=configuration.getStringProperty(Configuration.PARAM_HTTPSEND_IP);
  retries++;
  logger.info("String_Node_Str" + retries);
  ProgressController progress=new ProgressController(JDLocale.L("String_Node_Str","String_Node_Str"),10);
  progress.setStatusText(JDLocale.L("String_Node_Str","String_Node_Str" + retries));
  if (user != null || pass != null)   Authenticator.setDefault(new InternalAuthenticator(user,pass));
  if (script == null) {
    progress.finalize();
    return parseError("String_Node_Str");
  }
  String preIp=JDUtilities.getIPAddress();
  logger.finer("String_Node_Str" + preIp);
  progress.setStatusText(JDLocale.L("String_Node_Str","String_Node_Str") + preIp);
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  script=script.replaceAll("String_Node_Str","String_Node_Str");
  Document xmlScript;
  variables=new HashMap<String,String>();
  variables.put("String_Node_Str",user);
  variables.put("String_Node_Str",pass);
  variables.put("String_Node_Str",new BASE64Encoder().encode((user + "String_Node_Str" + pass).getBytes()));
  variables.put("String_Node_Str",ip);
  headerProperties=new HashMap<String,String>();
  progress.increase(1);
  try {
    xmlScript=parseXmlString(script,false);
    Node root=xmlScript.getChildNodes().item(0);
    if (root == null || !root.getNodeName().equalsIgnoreCase("String_Node_Str")) {
      progress.finalize();
      return parseError("String_Node_Str");
    }
    RequestInfo requestInfo=null;
    NodeList steps=root.getChildNodes();
    progress.addToMax(steps.getLength());
    for (int step=0; step < steps.getLength(); step++) {
      progress.setStatusText(JDLocale.L("String_Node_Str","String_Node_Str") + step);
      progress.increase(1);
      Node current=steps.item(step);
      if (current.getNodeType() == 3) {
        continue;
      }
      if (!current.getNodeName().equalsIgnoreCase("String_Node_Str")) {
        progress.finalize();
        return parseError("String_Node_Str" + current.getNodeName());
      }
      NodeList toDos=current.getChildNodes();
      for (int toDoStep=0; toDoStep < toDos.getLength(); toDoStep++) {
        Node toDo=toDos.item(toDoStep);
        try {
          progress.setStatusText(JDUtilities.sprintf(JDLocale.L("String_Node_Str","String_Node_Str"),new String[]{toDo.getNodeName()}));
        }
 catch (        Exception e) {
        }
        if (toDo.getNodeName().equalsIgnoreCase("String_Node_Str")) {
          NamedNodeMap attributes=toDo.getAttributes();
          for (int attribute=0; attribute < attributes.getLength(); attribute++) {
            String key=attributes.item(attribute).getNodeName();
            String value=attributes.item(attribute).getNodeValue();
            String[] tmp=value.split("String_Node_Str");
            ArrayList<String> params=Plugin.getAllSimpleMatches(value,"String_Node_Str",1);
            if (params.size() > 0) {
              String req;
              if (value.startsWith(params.get(0))) {
                req="String_Node_Str";
                logger.finer("String_Node_Str" + this.variables);
                logger.finer("String_Node_Str" + this.headerProperties);
                for (int i=0; i <= tmp.length; i++) {
                  logger.finer("String_Node_Str" + params.get(i - 1) + "String_Node_Str");
                  req+=getModifiedVariable(params.get(i - 1));
                  if (i < tmp.length) {
                    req+=tmp[i];
                  }
                }
              }
 else {
                req=tmp[0];
                logger.finer("String_Node_Str" + this.variables);
                logger.finer("String_Node_Str" + this.headerProperties);
                for (int i=1; i <= tmp.length; i++) {
                  if (i > params.size())                   continue;
                  logger.finer("String_Node_Str" + params.get(i - 1) + "String_Node_Str");
                  req+=getModifiedVariable(params.get(i - 1));
                  if (i < tmp.length) {
                    req+=tmp[i];
                  }
                }
              }
              value=req;
            }
            variables.put(key,value);
          }
          logger.finer("String_Node_Str" + variables);
        }
        if (toDo.getNodeName().equalsIgnoreCase("String_Node_Str")) {
          if (toDo.getChildNodes().getLength() != 1) {
            progress.finalize();
            return parseError("String_Node_Str");
          }
          requestInfo=doRequest(toDo.getChildNodes().item(0).getNodeValue().trim());
          if (requestInfo == null) {
            logger.severe("String_Node_Str" + toDo.getChildNodes().item(0).getNodeValue().trim());
          }
        }
        if (toDo.getNodeName().equalsIgnoreCase("String_Node_Str")) {
          logger.finer("String_Node_Str");
          if (toDo.getChildNodes().getLength() != 1) {
            progress.finalize();
            return parseError("String_Node_Str");
          }
          NamedNodeMap attributes=toDo.getAttributes();
          if (attributes.getNamedItem("String_Node_Str") == null) {
            progress.finalize();
            return parseError("String_Node_Str" + toDo);
          }
          String[] keys=attributes.getNamedItem("String_Node_Str").getNodeValue().split("String_Node_Str");
          getVariables(toDo.getChildNodes().item(0).getNodeValue().trim(),keys,requestInfo);
        }
        if (toDo.getNodeName().equalsIgnoreCase("String_Node_Str")) {
          NamedNodeMap attributes=toDo.getAttributes();
          Node item=attributes.getNamedItem("String_Node_Str");
          logger.finer("String_Node_Str" + item.getNodeValue() + "String_Node_Str");
          if (item == null) {
            return parseError("String_Node_Str");
          }
          int seconds=JDUtilities.filterInt(item.getNodeValue());
          Thread.sleep(seconds * 1000);
        }
      }
    }
  }
 catch (  SAXException e) {
    progress.finalize();
    return this.parseError(e.getMessage());
  }
catch (  ParserConfigurationException e) {
    e.printStackTrace();
    progress.finalize();
    return this.parseError(e.getMessage());
  }
catch (  Exception e) {
    e.printStackTrace();
    progress.finalize();
    return this.parseError(e.getCause() + "String_Node_Str" + e.getMessage());
  }
  int waittime=configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_IPCHECKWAITTIME,0);
  int maxretries=configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_RETRIES,0);
  int waitForIp=configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_WAITFORIPCHANGE,10);
  logger.finer("String_Node_Str" + waittime + "String_Node_Str");
  progress.increase(1);
  progress.setStatusText(JDLocale.L("String_Node_Str","String_Node_Str"));
  try {
    Thread.sleep(waittime * 1000);
  }
 catch (  InterruptedException e) {
  }
  String afterIP=JDUtilities.getIPAddress();
  logger.finer("String_Node_Str" + afterIP);
  progress.increase(1);
  String pattern;
  try {
    pattern=JDLocale.L("String_Node_Str","String_Node_Str");
    progress.setStatusText(JDUtilities.sprintf(pattern,new String[]{preIp,afterIP}));
  }
 catch (  Exception e) {
  }
  long endTime=System.currentTimeMillis() + waitForIp * 1000;
  while (System.currentTimeMillis() <= endTime && (afterIP.equalsIgnoreCase("String_Node_Str") || afterIP == null || afterIP.equals(preIp))) {
    try {
      Thread.sleep(5 * 1000);
    }
 catch (    InterruptedException e) {
    }
    afterIP=JDUtilities.getIPAddress();
    try {
      pattern=JDLocale.L("String_Node_Str","String_Node_Str");
      progress.setStatusText(JDUtilities.sprintf(pattern,new String[]{preIp,afterIP}));
    }
 catch (    Exception e) {
    }
    logger.finer("String_Node_Str" + afterIP);
  }
  if (!afterIP.equals(preIp) && !afterIP.equalsIgnoreCase("String_Node_Str")) {
    progress.finalize();
    logger.info("String_Node_Str" + afterIP);
    return true;
  }
  if (retries <= maxretries) {
    progress.finalize();
    return doInteraction(arg);
  }
  progress.finalize();
  logger.info("String_Node_Str" + afterIP);
  return false;
}