Program: 85424
Project: 85424
Buggy source:
public void execute() throws MojoExecutionException, MojoFailureException {
  if (!project.getPackaging().equalsIgnoreCase("String_Node_Str")) {
    String errorMsg="String_Node_Str";
    throw new MojoFailureException(errorMsg);
  }
  String appfuseVersion=project.getProperties().getProperty("String_Node_Str");
  if (appfuseVersion != null && !appfuseVersion.endsWith("String_Node_Str") && tag.equals("String_Node_Str")) {
    tag="String_Node_Str" + appfuseVersion.toUpperCase().replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str";
  }
  daoFramework=project.getProperties().getProperty("String_Node_Str");
  webFramework=project.getProperties().getProperty("String_Node_Str");
  if (project.getPackaging().equals("String_Node_Str") || (project.getPackaging().equals("String_Node_Str") && project.getParent() == null)) {
    log("String_Node_Str");
    export("String_Node_Str");
    export("String_Node_Str" + daoFramework + "String_Node_Str");
    log("String_Node_Str");
    export("String_Node_Str");
  }
  if (project.getPackaging().equalsIgnoreCase("String_Node_Str")) {
    log("String_Node_Str");
    export("String_Node_Str");
    log("String_Node_Str" + webFramework + "String_Node_Str");
    export("String_Node_Str" + webFramework + "String_Node_Str");
  }
  log("String_Node_Str");
  removeWarpathPlugin(new File("String_Node_Str"));
  List dependencies=project.getOriginalModel().getDependencies();
  List<Dependency> newDependencies=new ArrayList<Dependency>();
  for (  Object dependency : dependencies) {
    Dependency dep=(Dependency)dependency;
    if (!dep.getGroupId().equals(APPFUSE_GROUP_ID)) {
      newDependencies.add(dep);
    }
  }
  newDependencies=addModuleDependencies(newDependencies,"String_Node_Str","String_Node_Str");
  newDependencies=addModuleDependencies(newDependencies,daoFramework,"String_Node_Str" + daoFramework);
  newDependencies=addModuleDependencies(newDependencies,"String_Node_Str","String_Node_Str");
  newDependencies=addModuleDependencies(newDependencies,"String_Node_Str","String_Node_Str");
  newDependencies=addModuleDependencies(newDependencies,webFramework,"String_Node_Str" + webFramework,true);
  for (  Dependency dep : newDependencies) {
    if (dep.getArtifactId().equals("String_Node_Str") || dep.getArtifactId().equals("String_Node_Str") || dep.getArtifactId().equals("String_Node_Str")) {
      dep.setOptional(true);
      dep.setScope(null);
    }
  }
  Collections.sort(newDependencies,new BeanComparator("String_Node_Str"));
  project.getOriginalModel().setDependencies(newDependencies);
  project.getOriginalModel().setProperties(getAppFuseProperties());
  StringWriter writer=new StringWriter();
  try {
    project.writeOriginalModel(writer);
    File pom=new File("String_Node_Str");
    if (pom.exists()) {
      pom.delete();
    }
    FileWriter fw=new FileWriter(pom);
    fw.write(writer.toString());
    fw.flush();
    fw.close();
  }
 catch (  IOException ex) {
    getLog().error("String_Node_Str" + ex.getMessage(),ex);
    throw new MojoFailureException(ex.getMessage());
  }
  log("String_Node_Str");
  String pomXml=writer.toString();
  int startTag=pomXml.indexOf("String_Node_Str");
  String dependencyXml=pomXml.substring(startTag,pomXml.indexOf("String_Node_Str",startTag));
  dependencyXml=dependencyXml.replaceAll("String_Node_Str","String_Node_Str");
  dependencyXml="String_Node_Str" + dependencyXml;
  try {
    String originalPom=FileUtils.readFileToString(new File("String_Node_Str"));
    startTag=originalPom.indexOf("String_Node_Str");
    StringBuffer sb=new StringBuffer();
    sb.append(originalPom.substring(0,startTag));
    sb.append(dependencyXml);
    sb.append(originalPom.substring(originalPom.indexOf("String_Node_Str",startTag)));
    startTag=pomXml.indexOf("String_Node_Str");
    String propertiesXml=pomXml.substring(startTag + 16,pomXml.lastIndexOf("String_Node_Str"));
    propertiesXml=propertiesXml.replaceAll("String_Node_Str","String_Node_Str");
    propertiesXml="String_Node_Str" + project.getProperties().getProperty("String_Node_Str") + "String_Node_Str"+ propertiesXml;
    propertiesXml="String_Node_Str" + propertiesXml;
    String pomWithProperties=sb.toString().replaceFirst("String_Node_Str",propertiesXml);
    FileUtils.writeStringToFile(new File("String_Node_Str"),pomWithProperties);
  }
 catch (  IOException ex) {
    getLog().error("String_Node_Str" + ex.getMessage(),ex);
    throw new MojoFailureException(ex.getMessage());
  }
  log("String_Node_Str");
  log("String_Node_Str");
  File pom=new File("String_Node_Str");
  if (pom.exists()) {
    pom.delete();
  }
}

Fixed version (ground truth):
public void execute() throws MojoExecutionException, MojoFailureException {
  if (!project.getPackaging().equalsIgnoreCase("String_Node_Str")) {
    String errorMsg="String_Node_Str";
    throw new MojoFailureException(errorMsg);
  }
  String appfuseVersion=project.getProperties().getProperty("String_Node_Str");
  if (appfuseVersion != null && !appfuseVersion.endsWith("String_Node_Str") && tag.equals("String_Node_Str")) {
    tag="String_Node_Str" + appfuseVersion.toUpperCase().replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str";
  }
  daoFramework=project.getProperties().getProperty("String_Node_Str");
  webFramework=project.getProperties().getProperty("String_Node_Str");
  if (project.getPackaging().equals("String_Node_Str") || (project.getPackaging().equals("String_Node_Str") && project.getParent() == null)) {
    log("String_Node_Str");
    export("String_Node_Str");
    export("String_Node_Str" + daoFramework + "String_Node_Str");
    if (daoFramework.equalsIgnoreCase("String_Node_Str")) {
      File duplicateFile=new File(getFilePath("String_Node_Str"));
      if (duplicateFile.exists()) {
        log("String_Node_Str");
        try {
          FileUtils.forceDeleteOnExit(duplicateFile);
        }
 catch (        IOException io) {
          getLog().error("String_Node_Str");
        }
      }
    }
 else     if (daoFramework.equalsIgnoreCase("String_Node_Str")) {
      File duplicateFile=new File(getFilePath("String_Node_Str"));
      if (duplicateFile.exists()) {
        log("String_Node_Str");
        try {
          FileUtils.forceDeleteOnExit(duplicateFile);
        }
 catch (        IOException io) {
          getLog().error("String_Node_Str");
        }
      }
    }
    log("String_Node_Str");
    export("String_Node_Str");
  }
  if (project.getPackaging().equalsIgnoreCase("String_Node_Str")) {
    log("String_Node_Str");
    export("String_Node_Str");
    log("String_Node_Str" + webFramework + "String_Node_Str");
    export("String_Node_Str" + webFramework + "String_Node_Str");
  }
  log("String_Node_Str");
  removeWarpathPlugin(new File("String_Node_Str"));
  List dependencies=project.getOriginalModel().getDependencies();
  List<Dependency> newDependencies=new ArrayList<Dependency>();
  for (  Object dependency : dependencies) {
    Dependency dep=(Dependency)dependency;
    if (!dep.getGroupId().equals(APPFUSE_GROUP_ID)) {
      newDependencies.add(dep);
    }
  }
  newDependencies=addModuleDependencies(newDependencies,"String_Node_Str","String_Node_Str");
  newDependencies=addModuleDependencies(newDependencies,daoFramework,"String_Node_Str" + daoFramework);
  newDependencies=addModuleDependencies(newDependencies,"String_Node_Str","String_Node_Str");
  newDependencies=addModuleDependencies(newDependencies,"String_Node_Str","String_Node_Str");
  newDependencies=addModuleDependencies(newDependencies,webFramework,"String_Node_Str" + webFramework,true);
  for (  Dependency dep : newDependencies) {
    if (dep.getArtifactId().equals("String_Node_Str") || dep.getArtifactId().equals("String_Node_Str") || dep.getArtifactId().equals("String_Node_Str")) {
      dep.setOptional(true);
      dep.setScope(null);
    }
  }
  Collections.sort(newDependencies,new BeanComparator("String_Node_Str"));
  project.getOriginalModel().setDependencies(newDependencies);
  project.getOriginalModel().setProperties(getAppFuseProperties());
  StringWriter writer=new StringWriter();
  try {
    project.writeOriginalModel(writer);
    File pom=new File("String_Node_Str");
    if (pom.exists()) {
      pom.delete();
    }
    FileWriter fw=new FileWriter(pom);
    fw.write(writer.toString());
    fw.flush();
    fw.close();
  }
 catch (  IOException ex) {
    getLog().error("String_Node_Str" + ex.getMessage(),ex);
    throw new MojoFailureException(ex.getMessage());
  }
  log("String_Node_Str");
  String pomXml=writer.toString();
  int startTag=pomXml.indexOf("String_Node_Str");
  String dependencyXml=pomXml.substring(startTag,pomXml.indexOf("String_Node_Str",startTag));
  dependencyXml=dependencyXml.replaceAll("String_Node_Str","String_Node_Str");
  dependencyXml="String_Node_Str" + dependencyXml;
  try {
    String originalPom=FileUtils.readFileToString(new File("String_Node_Str"));
    startTag=originalPom.indexOf("String_Node_Str");
    StringBuffer sb=new StringBuffer();
    sb.append(originalPom.substring(0,startTag));
    sb.append(dependencyXml);
    sb.append(originalPom.substring(originalPom.indexOf("String_Node_Str",startTag)));
    startTag=pomXml.indexOf("String_Node_Str");
    String propertiesXml=pomXml.substring(startTag + 16,pomXml.lastIndexOf("String_Node_Str"));
    propertiesXml=propertiesXml.replaceAll("String_Node_Str","String_Node_Str");
    propertiesXml="String_Node_Str" + project.getProperties().getProperty("String_Node_Str") + "String_Node_Str"+ propertiesXml;
    propertiesXml="String_Node_Str" + propertiesXml;
    String pomWithProperties=sb.toString().replaceFirst("String_Node_Str",propertiesXml);
    FileUtils.writeStringToFile(new File("String_Node_Str"),pomWithProperties);
  }
 catch (  IOException ex) {
    getLog().error("String_Node_Str" + ex.getMessage(),ex);
    throw new MojoFailureException(ex.getMessage());
  }
  log("String_Node_Str");
  log("String_Node_Str");
  File pom=new File("String_Node_Str");
  if (pom.exists()) {
    pom.delete();
  }
}