Program: 50943
Project: 50943
Buggy source:
private void addJBossPlugin(File pomFile) throws PhrescoException {
  try {
    PomProcessor pomProcessor=new PomProcessor(pomFile);
    Plugin plugin=pomProcessor.getPlugin("String_Node_Str","String_Node_Str");
    if (plugin != null) {
      return;
    }
    pomProcessor.addPlugin("String_Node_Str","String_Node_Str","String_Node_Str");
    List<Element> configList=new ArrayList<Element>();
    DocumentBuilderFactory dbfac=DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder=dbfac.newDocumentBuilder();
    Document doc=docBuilder.newDocument();
    Element containerElement=doc.createElement("String_Node_Str");
    Element containerId=doc.createElement("String_Node_Str");
    containerId.setTextContent("String_Node_Str");
    containerElement.appendChild(containerId);
    Element type=doc.createElement("String_Node_Str");
    type.setTextContent("String_Node_Str");
    containerElement.appendChild(type);
    Element home=doc.createElement("String_Node_Str");
    home.setTextContent("String_Node_Str");
    containerElement.appendChild(home);
    Element configurationElement=doc.createElement("String_Node_Str");
    Element innerType=doc.createElement("String_Node_Str");
    innerType.setTextContent("String_Node_Str");
    configurationElement.appendChild(innerType);
    Element propertyElement=doc.createElement("String_Node_Str");
    configurationElement.appendChild(propertyElement);
    Element cargoHome=doc.createElement("String_Node_Str");
    cargoHome.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoHome);
    Element cargoMgmtPort=doc.createElement("String_Node_Str");
    cargoMgmtPort.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoMgmtPort);
    Element cargoRmiPort=doc.createElement("String_Node_Str");
    cargoRmiPort.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoRmiPort);
    Element cargoUserName=doc.createElement("String_Node_Str");
    cargoUserName.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoUserName);
    Element cargoPwd=doc.createElement("String_Node_Str");
    cargoPwd.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoPwd);
    configurationElement.appendChild(propertyElement);
    configList.add(containerElement);
    configList.add(configurationElement);
    pomProcessor.addConfiguration("String_Node_Str","String_Node_Str",configList);
    Dependency dependency=new Dependency();
    dependency.setGroupId("String_Node_Str");
    dependency.setArtifactId("String_Node_Str");
    dependency.setVersion("String_Node_Str");
    pomProcessor.addPluginDependency("String_Node_Str","String_Node_Str",dependency);
    pomProcessor.save();
  }
 catch (  JAXBException e) {
    throw new PhrescoException(e);
  }
catch (  IOException e) {
    throw new PhrescoException(e);
  }
catch (  ParserConfigurationException e) {
    throw new PhrescoException(e);
  }
catch (  PhrescoPomException e) {
    throw new PhrescoException(e);
  }
}

Fixed version (ground truth):
private void addJBossPlugin(File pomFile) throws PhrescoException {
  try {
    PomProcessor pomProcessor=new PomProcessor(pomFile);
    Plugin plugin=pomProcessor.getPlugin("String_Node_Str","String_Node_Str");
    if (plugin != null) {
      return;
    }
    pomProcessor.addPlugin("String_Node_Str","String_Node_Str","String_Node_Str");
    List<Element> configList=new ArrayList<Element>();
    DocumentBuilderFactory dbfac=DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder=dbfac.newDocumentBuilder();
    Document doc=docBuilder.newDocument();
    Element containerElement=doc.createElement("String_Node_Str");
    Element containerId=doc.createElement("String_Node_Str");
    containerId.setTextContent("String_Node_Str");
    containerElement.appendChild(containerId);
    Element type=doc.createElement("String_Node_Str");
    type.setTextContent("String_Node_Str");
    containerElement.appendChild(type);
    Element home=doc.createElement("String_Node_Str");
    home.setTextContent("String_Node_Str");
    containerElement.appendChild(home);
    Element configurationElement=doc.createElement("String_Node_Str");
    Element innerType=doc.createElement("String_Node_Str");
    innerType.setTextContent("String_Node_Str");
    configurationElement.appendChild(innerType);
    Element propertyElement=doc.createElement("String_Node_Str");
    configurationElement.appendChild(propertyElement);
    Element cargoHome=doc.createElement("String_Node_Str");
    cargoHome.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoHome);
    Element cargoMgmtPort=doc.createElement("String_Node_Str");
    cargoMgmtPort.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoMgmtPort);
    Element cargoRmiPort=doc.createElement("String_Node_Str");
    cargoRmiPort.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoRmiPort);
    Element cargoUserName=doc.createElement("String_Node_Str");
    cargoUserName.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoUserName);
    Element cargoPwd=doc.createElement("String_Node_Str");
    cargoPwd.setTextContent("String_Node_Str");
    propertyElement.appendChild(cargoPwd);
    configurationElement.appendChild(propertyElement);
    Element deployables=doc.createElement("String_Node_Str");
    Element deployable=doc.createElement("String_Node_Str");
    deployables.appendChild(deployable);
    Element location=doc.createElement("String_Node_Str");
    location.setTextContent("String_Node_Str");
    deployable.appendChild(location);
    configurationElement.appendChild(deployables);
    configList.add(containerElement);
    configList.add(configurationElement);
    pomProcessor.addConfiguration("String_Node_Str","String_Node_Str",configList);
    Dependency dependency=new Dependency();
    dependency.setGroupId("String_Node_Str");
    dependency.setArtifactId("String_Node_Str");
    dependency.setVersion("String_Node_Str");
    pomProcessor.addPluginDependency("String_Node_Str","String_Node_Str",dependency);
    pomProcessor.save();
  }
 catch (  JAXBException e) {
    throw new PhrescoException(e);
  }
catch (  IOException e) {
    throw new PhrescoException(e);
  }
catch (  ParserConfigurationException e) {
    throw new PhrescoException(e);
  }
catch (  PhrescoPomException e) {
    throw new PhrescoException(e);
  }
}