Program: 13031
Project: 13031
Buggy source:
@Override public void handleNodeNeighboursDiscovered(Node node,NodeDiscoveryResult nodeDiscoveryResult){
  File baseDir=new File(projectPath,labelDirName);
  File graphmlDir=new File(baseDir,graphmlDirName);
  if (!graphmlDir.exists())   graphmlDir.mkdir();
  String nodeFileName=node.getId();
  String discoveredIPv4Address=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  DiscoveredDevice discoveredDevice=(DiscoveredDevice)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  Map<String,String> subnetDetails=(Map<String,String>)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  String icmpStatus=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  String dnsFQDN=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  String dnsPQDN=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  HashMap<String,Object> params=new HashMap<>();
  ArrayList<GraphmlNode> graphmlNodes=new ArrayList<>();
  List<GraphmlEdge> graphmlEdges=new ArrayList<>();
  GraphmlNode mainNode=new GraphmlNode(node.getId(),node.getId());
  List<GraphmlNodeData> mainNodeGraphmlDatas=new ArrayList<>();
  if (icmpStatus != null) {
    GraphmlNodeData icmpNodeData=new GraphmlNodeData("String_Node_Str",icmpStatus);
    mainNodeGraphmlDatas.add(icmpNodeData);
    GraphmlNodeData discoveredIPv4AddressNodeData=new GraphmlNodeData("String_Node_Str",discoveredIPv4Address);
    mainNodeGraphmlDatas.add(discoveredIPv4AddressNodeData);
  }
  if (discoveredDevice != null) {
    GraphmlNodeData snmpStatus=new GraphmlNodeData("String_Node_Str","String_Node_Str");
    GraphmlNodeData discoveredIPv4AddressNodeData=new GraphmlNodeData("String_Node_Str",discoveredIPv4Address);
    mainNodeGraphmlDatas.add(discoveredIPv4AddressNodeData);
    mainNodeGraphmlDatas.add(snmpStatus);
    List<GraphmlNodeData> snmpNodeData=getSnmpMainNode(discoveredDevice);
    mainNodeGraphmlDatas.addAll(snmpNodeData);
    DeviceToGraphml deviceToGraphml=new DeviceToGraphml(node,discoveredDevice);
    graphmlNodes.addAll(deviceToGraphml.getSubnetNodes());
    graphmlNodes.addAll(deviceToGraphml.getNonSubnetNeighbours());
    graphmlEdges=deviceToGraphml.getSubnetEdgesToMainNode();
    graphmlEdges.addAll(deviceToGraphml.getEdgesToNeighbours());
  }
  if (subnetDetails != null) {
    List<GraphmlNodeData> subnetNodeData=getSubnetMainNode(subnetDetails);
    String bogonSubnetMarker=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
    String privateSubnetMarker=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
    if (bogonSubnetMarker != null && bogonSubnetMarker.equals("String_Node_Str"))     subnetNodeData.add(new GraphmlNodeData("String_Node_Str","String_Node_Str"));
 else     subnetNodeData.add(new GraphmlNodeData("String_Node_Str","String_Node_Str"));
    if (privateSubnetMarker != null && privateSubnetMarker.equals("String_Node_Str"))     subnetNodeData.add(new GraphmlNodeData("String_Node_Str","String_Node_Str"));
 else     subnetNodeData.add(new GraphmlNodeData("String_Node_Str","String_Node_Str"));
    mainNodeGraphmlDatas.addAll(subnetNodeData);
    String subnetIpAddress=subnetDetails.get("String_Node_Str");
    String subnetPrefixMask=subnetDetails.get("String_Node_Str");
    nodeFileName=subnetIpAddress + "String_Node_Str" + subnetPrefixMask;
  }
  if (dnsFQDN != null) {
    GraphmlNodeData fqdn=new GraphmlNodeData("String_Node_Str",dnsFQDN);
    mainNodeGraphmlDatas.add(fqdn);
    GraphmlNodeData pqdn=new GraphmlNodeData("String_Node_Str",dnsPQDN);
    mainNodeGraphmlDatas.add(pqdn);
  }
  if (icmpStatus == null && dnsFQDN == null && discoveredDevice == null && subnetDetails == null)   return;
  mainNode.setGraphmlNodeDataList(mainNodeGraphmlDatas);
  graphmlNodes.add(mainNode);
  params.put("String_Node_Str",graphmlNodes);
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str",graphmlEdges);
  try {
    String projectName=new File(projectPath).getName();
    if (projectName.equals("String_Node_Str"))     projectName=new File(new File(projectPath).getParent()).getName();
    params.put("String_Node_Str",projectName);
    params.put("String_Node_Str",baseDir.getCanonicalFile().getName());
  }
 catch (  IOException e) {
    logger.error(e);
  }
  String graphml=null;
  try {
    logger.info("String_Node_Str" + node.getId());
    graphml=graphmlRenderer.render(velocityTemplate,params);
    logger.info("String_Node_Str" + node.getId());
  }
 catch (  Exception e) {
    logger.trace(e.getMessage());
  }
  logger.trace(graphml);
  final String fileName="String_Node_Str" + nodeFileName + "String_Node_Str";
  final File nodeFile=new File(graphmlDir,fileName);
  try {
    FileUtils.writeStringToFile(nodeFile,graphml);
    File undirectedGraphmls=new File(graphmlDir.getParent(),"String_Node_Str" + "String_Node_Str");
    if (!undirectedGraphmls.exists()) {
      undirectedGraphmls.createNewFile();
    }
    FileWriter writer=new FileWriter(undirectedGraphmls,true);
    writer.append(String.valueOf(fileName)).append("String_Node_Str");
    writer.close();
  }
 catch (  IOException e) {
    logger.error(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void handleNodeNeighboursDiscovered(Node node,NodeDiscoveryResult nodeDiscoveryResult){
  File baseDir=new File(projectPath,labelDirName);
  File graphmlDir=new File(baseDir,graphmlDirName);
  if (!graphmlDir.exists())   graphmlDir.mkdir();
  String nodeFileName=node.getId();
  String discoveredIPv4Address=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  DiscoveredDevice discoveredDevice=(DiscoveredDevice)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  Map<String,String> subnetDetails=(Map<String,String>)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  String icmpStatus=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  String dnsFQDN=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  String dnsPQDN=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
  HashMap<String,Object> params=new HashMap<>();
  ArrayList<GraphmlNode> graphmlNodes=new ArrayList<>();
  List<GraphmlEdge> graphmlEdges=new ArrayList<>();
  GraphmlNode mainNode=new GraphmlNode(node.getId(),node.getId());
  List<GraphmlNodeData> mainNodeGraphmlDatas=new ArrayList<>();
  if (icmpStatus != null) {
    GraphmlNodeData icmpNodeData=new GraphmlNodeData("String_Node_Str",icmpStatus);
    mainNodeGraphmlDatas.add(icmpNodeData);
    GraphmlNodeData discoveredIPv4AddressNodeData=new GraphmlNodeData("String_Node_Str",discoveredIPv4Address);
    mainNodeGraphmlDatas.add(discoveredIPv4AddressNodeData);
  }
  if (discoveredDevice != null) {
    GraphmlNodeData snmpStatus=new GraphmlNodeData("String_Node_Str","String_Node_Str");
    GraphmlNodeData discoveredIPv4AddressNodeData=new GraphmlNodeData("String_Node_Str",discoveredIPv4Address);
    mainNodeGraphmlDatas.add(discoveredIPv4AddressNodeData);
    mainNodeGraphmlDatas.add(snmpStatus);
    List<GraphmlNodeData> snmpNodeData=getSnmpMainNode(discoveredDevice);
    mainNodeGraphmlDatas.addAll(snmpNodeData);
    DeviceToGraphml deviceToGraphml=new DeviceToGraphml(node,discoveredDevice);
    graphmlNodes.addAll(deviceToGraphml.getSubnetNodes());
    graphmlNodes.addAll(deviceToGraphml.getNonSubnetNeighbours());
    graphmlEdges=deviceToGraphml.getSubnetEdgesToMainNode();
    graphmlEdges.addAll(deviceToGraphml.getEdgesToNeighbours());
  }
  if (subnetDetails != null) {
    List<GraphmlNodeData> subnetNodeData=getSubnetMainNode(subnetDetails);
    String bogonSubnetMarker=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
    String privateSubnetMarker=(String)nodeDiscoveryResult.getDiscoveredData().get("String_Node_Str");
    if (bogonSubnetMarker != null && bogonSubnetMarker.equals("String_Node_Str"))     subnetNodeData.add(new GraphmlNodeData("String_Node_Str","String_Node_Str"));
 else     subnetNodeData.add(new GraphmlNodeData("String_Node_Str","String_Node_Str"));
    if (privateSubnetMarker != null && privateSubnetMarker.equals("String_Node_Str"))     subnetNodeData.add(new GraphmlNodeData("String_Node_Str","String_Node_Str"));
 else     subnetNodeData.add(new GraphmlNodeData("String_Node_Str","String_Node_Str"));
    mainNodeGraphmlDatas.addAll(subnetNodeData);
    List<GraphmlNode> subnetNeighbourNodes=new ArrayList<>();
    List<GraphmlEdge> subnetNeighbourEdges=new ArrayList<>();
    for (    Node subnetNeighbour : node.getNeighbours()) {
      AliasResolver aliasResolver=new AliasResolver(node,subnetNeighbour.getId(),null,null);
      String neighbourId=aliasResolver.getNeighbourIdFromAliases();
      GraphmlNode subnetNeighbourNode;
      if (neighbourId == null)       neighbourId=subnetNeighbour.getId();
      subnetNeighbourNode=new GraphmlNode(neighbourId,neighbourId);
      subnetNeighbourNodes.add(subnetNeighbourNode);
      EdgeIdGenerator edgeIdGenerator=new EdgeIdGenerator(neighbourId,node.getId(),neighbourId,node.getId());
      GraphmlEdge subnetNeighbourEdge=edgeIdGenerator.createEdge();
      subnetNeighbourEdges.add(subnetNeighbourEdge);
    }
    graphmlNodes.addAll(subnetNeighbourNodes);
    graphmlEdges.addAll(subnetNeighbourEdges);
    String subnetIpAddress=subnetDetails.get("String_Node_Str");
    String subnetPrefixMask=subnetDetails.get("String_Node_Str");
    nodeFileName=subnetIpAddress + "String_Node_Str" + subnetPrefixMask;
  }
  if (dnsFQDN != null) {
    GraphmlNodeData fqdn=new GraphmlNodeData("String_Node_Str",dnsFQDN);
    mainNodeGraphmlDatas.add(fqdn);
    GraphmlNodeData pqdn=new GraphmlNodeData("String_Node_Str",dnsPQDN);
    mainNodeGraphmlDatas.add(pqdn);
  }
  if (icmpStatus == null && dnsFQDN == null && discoveredDevice == null && subnetDetails == null)   return;
  mainNode.setGraphmlNodeDataList(mainNodeGraphmlDatas);
  graphmlNodes.add(mainNode);
  params.put("String_Node_Str",graphmlNodes);
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str",graphmlEdges);
  try {
    String projectName=new File(projectPath).getName();
    if (projectName.equals("String_Node_Str"))     projectName=new File(new File(projectPath).getParent()).getName();
    params.put("String_Node_Str",projectName);
    params.put("String_Node_Str",baseDir.getCanonicalFile().getName());
  }
 catch (  IOException e) {
    logger.error(e);
  }
  String graphml=null;
  try {
    logger.info("String_Node_Str" + node.getId());
    graphml=graphmlRenderer.render(velocityTemplate,params);
    logger.info("String_Node_Str" + node.getId());
  }
 catch (  Exception e) {
    logger.trace(e.getMessage());
  }
  logger.trace(graphml);
  final String fileName="String_Node_Str" + nodeFileName + "String_Node_Str";
  final File nodeFile=new File(graphmlDir,fileName);
  try {
    FileUtils.writeStringToFile(nodeFile,graphml);
    File undirectedGraphmls=new File(graphmlDir.getParent(),"String_Node_Str" + "String_Node_Str");
    if (!undirectedGraphmls.exists()) {
      undirectedGraphmls.createNewFile();
    }
    FileWriter writer=new FileWriter(undirectedGraphmls,true);
    writer.append(String.valueOf(fileName)).append("String_Node_Str");
    writer.close();
  }
 catch (  IOException e) {
    logger.error(e.getMessage());
  }
}