Program: 143050
Project: 143050
Buggy source:
private void parseNodes(NodeList nodeListE,String parent) throws Exception {
  for (int i=0; i < nodeListE.getLength(); i++) {
    Element nodeE=(Element)nodeListE.item(i);
    if (!nodeE.getNodeName().equals("String_Node_Str")) {
      report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeE.getNodeName()),Issue.Level.WARNING));
      return;
    }
    if (parent == null) {
      Progress.progress(progressTicket);
    }
    if (cancel) {
      return;
    }
    String nodeId=nodeE.getAttribute("String_Node_Str");
    if (nodeId.isEmpty()) {
      report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str"),Issue.Level.SEVERE));
      continue;
    }
    NodeDraft node=container.factory().newNodeDraft();
    node.setId(nodeId);
    if (!nodeE.getAttribute("String_Node_Str").isEmpty() && !nodeE.getAttribute("String_Node_Str").equals("String_Node_Str")) {
      String pid=nodeE.getAttribute("String_Node_Str");
      if (!container.nodeExists(pid)) {
        if (unknownParents.containsKey(pid)) {
          unknownParents.get(pid).add(nodeId);
        }
 else {
          List<String> childList=new ArrayList<String>();
          childList.add(nodeId);
          unknownParents.put(pid,childList);
        }
      }
 else {
        node.setParent(container.getNode(pid));
      }
    }
 else     if (parent != null) {
      node.setParent(container.getNode(parent));
    }
    String nodeLabel=nodeE.getAttribute("String_Node_Str");
    if (nodeLabel.isEmpty()) {
      report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId),Issue.Level.SEVERE));
      continue;
    }
    node.setLabel(nodeLabel);
    Node child=nodeE.getFirstChild();
    if (child != null) {
      do {
        if (child.getNodeName().equals("String_Node_Str")) {
          Node childE=child.getFirstChild();
          if (childE != null) {
            do {
              if (childE.getNodeName().equals("String_Node_Str")) {
                Element dataE=(Element)childE;
                setNodeData(dataE,node,nodeId);
              }
            }
 while ((childE=childE.getNextSibling()) != null);
          }
        }
      }
 while ((child=child.getNextSibling()) != null);
    }
    Element nodeColor=(Element)nodeE.getElementsByTagName("String_Node_Str").item(0);
    if (nodeColor != null) {
      String rStr=nodeColor.getAttribute("String_Node_Str");
      String gStr=nodeColor.getAttribute("String_Node_Str");
      String bStr=nodeColor.getAttribute("String_Node_Str");
      int r=(rStr.isEmpty()) ? 0 : Integer.parseInt(rStr);
      int g=(gStr.isEmpty()) ? 0 : Integer.parseInt(gStr);
      int b=(bStr.isEmpty()) ? 0 : Integer.parseInt(bStr);
      node.setColor(new Color(r,g,b));
    }
    Element nodePosition=(Element)nodeE.getElementsByTagName("String_Node_Str").item(0);
    if (nodePosition != null) {
      try {
        String xStr=nodePosition.getAttribute("String_Node_Str");
        if (!xStr.isEmpty()) {
          float x=Float.parseFloat(xStr);
          node.setX(x);
        }
      }
 catch (      NumberFormatException e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId,"String_Node_Str"),Issue.Level.WARNING));
      }
      try {
        String yStr=nodePosition.getAttribute("String_Node_Str");
        if (!yStr.isEmpty()) {
          float y=Float.parseFloat(yStr);
          node.setY(y);
        }
      }
 catch (      NumberFormatException e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId,"String_Node_Str"),Issue.Level.WARNING));
      }
      try {
        String zStr=nodePosition.getAttribute("String_Node_Str");
        if (!zStr.isEmpty()) {
          float z=Float.parseFloat(zStr);
          node.setZ(z);
        }
      }
 catch (      NumberFormatException e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId,"String_Node_Str"),Issue.Level.WARNING));
      }
    }
    Element nodeSize=(Element)nodeE.getElementsByTagName("String_Node_Str").item(0);
    if (nodeSize != null) {
      try {
        float size=Float.parseFloat(nodeSize.getAttribute("String_Node_Str"));
        node.setSize(size);
      }
 catch (      NumberFormatException e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId),Issue.Level.WARNING));
      }
    }
    if (isDynamicMode) {
      String dateFrom=null;
      String dateTo=null;
      if (!nodeE.getAttribute("String_Node_Str").isEmpty()) {
        dateFrom=nodeE.getAttribute("String_Node_Str");
      }
      if (!nodeE.getAttribute("String_Node_Str").isEmpty()) {
        dateTo=nodeE.getAttribute("String_Node_Str");
      }
      if (dateFrom != null || dateTo != null) {
        node.addTimeSlice(dateFrom,dateTo);
      }
    }
    container.addNode(node);
    Node childNode=nodeE.getFirstChild();
    if (childNode != null) {
      do {
        if (childNode.getNodeName().equals("String_Node_Str")) {
          Node childE=childNode.getFirstChild();
          NodeList childrenListE=childE.getChildNodes();
          if (childrenListE != null && childrenListE.getLength() > 0) {
            parseNodes(childrenListE,nodeId);
          }
        }
      }
 while ((childNode=childNode.getNextSibling()) != null);
    }
    Node childEdge=nodeE.getFirstChild();
    if (childEdge != null) {
      do {
        if (childEdge.getNodeName().equals("String_Node_Str")) {
          Node childE=childEdge.getFirstChild();
          NodeList childrenListE=childE.getChildNodes();
          if (childrenListE != null && childrenListE.getLength() > 0) {
            parseEdges(childrenListE,nodeId);
          }
        }
      }
 while ((childEdge=childEdge.getNextSibling()) != null);
    }
  }
}

Fixed version (ground truth):
private void parseNodes(NodeList nodeListE,String parent) throws Exception {
  for (int i=0; i < nodeListE.getLength(); i++) {
    Element nodeE=(Element)nodeListE.item(i);
    if (!nodeE.getNodeName().equals("String_Node_Str")) {
      report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeE.getNodeName()),Issue.Level.WARNING));
      return;
    }
    if (parent == null) {
      Progress.progress(progressTicket);
    }
    if (cancel) {
      return;
    }
    String nodeId=nodeE.getAttribute("String_Node_Str");
    if (nodeId.isEmpty()) {
      report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str"),Issue.Level.SEVERE));
      continue;
    }
    NodeDraft node=container.factory().newNodeDraft();
    node.setId(nodeId);
    if (!nodeE.getAttribute("String_Node_Str").isEmpty() && !nodeE.getAttribute("String_Node_Str").equals("String_Node_Str")) {
      String pid=nodeE.getAttribute("String_Node_Str");
      if (!container.nodeExists(pid)) {
        if (unknownParents.containsKey(pid)) {
          unknownParents.get(pid).add(nodeId);
        }
 else {
          List<String> childList=new ArrayList<String>();
          childList.add(nodeId);
          unknownParents.put(pid,childList);
        }
      }
 else {
        node.setParent(container.getNode(pid));
      }
    }
 else     if (parent != null) {
      node.setParent(container.getNode(parent));
    }
    String nodeLabel=nodeE.getAttribute("String_Node_Str");
    node.setLabel(nodeLabel);
    Node child=nodeE.getFirstChild();
    if (child != null) {
      do {
        if (child.getNodeName().equals("String_Node_Str")) {
          Node childE=child.getFirstChild();
          if (childE != null) {
            do {
              if (childE.getNodeName().equals("String_Node_Str")) {
                Element dataE=(Element)childE;
                setNodeData(dataE,node,nodeId);
              }
            }
 while ((childE=childE.getNextSibling()) != null);
          }
        }
      }
 while ((child=child.getNextSibling()) != null);
    }
    Element nodeColor=(Element)nodeE.getElementsByTagName("String_Node_Str").item(0);
    if (nodeColor != null) {
      String rStr=nodeColor.getAttribute("String_Node_Str");
      String gStr=nodeColor.getAttribute("String_Node_Str");
      String bStr=nodeColor.getAttribute("String_Node_Str");
      int r=(rStr.isEmpty()) ? 0 : Integer.parseInt(rStr);
      int g=(gStr.isEmpty()) ? 0 : Integer.parseInt(gStr);
      int b=(bStr.isEmpty()) ? 0 : Integer.parseInt(bStr);
      node.setColor(new Color(r,g,b));
    }
    Element nodePosition=(Element)nodeE.getElementsByTagName("String_Node_Str").item(0);
    if (nodePosition != null) {
      try {
        String xStr=nodePosition.getAttribute("String_Node_Str");
        if (!xStr.isEmpty()) {
          float x=Float.parseFloat(xStr);
          node.setX(x);
        }
      }
 catch (      NumberFormatException e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId,"String_Node_Str"),Issue.Level.WARNING));
      }
      try {
        String yStr=nodePosition.getAttribute("String_Node_Str");
        if (!yStr.isEmpty()) {
          float y=Float.parseFloat(yStr);
          node.setY(y);
        }
      }
 catch (      NumberFormatException e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId,"String_Node_Str"),Issue.Level.WARNING));
      }
      try {
        String zStr=nodePosition.getAttribute("String_Node_Str");
        if (!zStr.isEmpty()) {
          float z=Float.parseFloat(zStr);
          node.setZ(z);
        }
      }
 catch (      NumberFormatException e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId,"String_Node_Str"),Issue.Level.WARNING));
      }
    }
    Element nodeSize=(Element)nodeE.getElementsByTagName("String_Node_Str").item(0);
    if (nodeSize != null) {
      try {
        float size=Float.parseFloat(nodeSize.getAttribute("String_Node_Str"));
        node.setSize(size);
      }
 catch (      NumberFormatException e) {
        report.logIssue(new Issue(NbBundle.getMessage(ImporterGEXF.class,"String_Node_Str",nodeId),Issue.Level.WARNING));
      }
    }
    if (isDynamicMode) {
      String dateFrom=null;
      String dateTo=null;
      if (!nodeE.getAttribute("String_Node_Str").isEmpty()) {
        dateFrom=nodeE.getAttribute("String_Node_Str");
      }
      if (!nodeE.getAttribute("String_Node_Str").isEmpty()) {
        dateTo=nodeE.getAttribute("String_Node_Str");
      }
      if (dateFrom != null || dateTo != null) {
        node.addTimeSlice(dateFrom,dateTo);
      }
    }
    container.addNode(node);
    Node childNode=nodeE.getFirstChild();
    if (childNode != null) {
      do {
        if (childNode.getNodeName().equals("String_Node_Str")) {
          Node childE=childNode.getFirstChild();
          NodeList childrenListE=childE.getChildNodes();
          if (childrenListE != null && childrenListE.getLength() > 0) {
            parseNodes(childrenListE,nodeId);
          }
        }
      }
 while ((childNode=childNode.getNextSibling()) != null);
    }
    Node childEdge=nodeE.getFirstChild();
    if (childEdge != null) {
      do {
        if (childEdge.getNodeName().equals("String_Node_Str")) {
          Node childE=childEdge.getFirstChild();
          NodeList childrenListE=childE.getChildNodes();
          if (childrenListE != null && childrenListE.getLength() > 0) {
            parseEdges(childrenListE,nodeId);
          }
        }
      }
 while ((childEdge=childEdge.getNextSibling()) != null);
    }
  }
}