Program: 132054
Project: 132054
Buggy source:
@Override public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>,DataObject> change){
  printTraceStart(LOG);
  Map<InstanceIdentifier<?>,DataObject> dataOriginalDataObject=change.getOriginalData();
  Map<InstanceIdentifier<?>,DataObject> dataCreatedObject=change.getCreatedData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataCreatedObject.entrySet()) {
    if (entry.getValue() instanceof Node) {
      Node node=(Node)entry.getValue();
      String nodeName=node.getNodeId().getValue();
      LOG.debug("String_Node_Str",node.toString());
    }
  }
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : change.getCreatedData().entrySet()) {
    Node node=null;
    if (entry.getKey().getTargetType() == NetconfNode.class) {
      NodeId nodeId=getNodeId(entry);
      String nodeName=nodeId.getValue();
      NetconfNode nnode=(NetconfNode)entry.getValue();
      LOG.info("String_Node_Str",nodeName);
    }
  }
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : change.getUpdatedData().entrySet()) {
    if (entry.getKey().getTargetType() == NetconfNode.class && !dataCreatedObject.containsKey(entry.getKey())) {
      NodeId nodeId=getNodeId(entry);
      String nodeName=nodeId.getValue();
      if (!nodeName.equals("String_Node_Str")) {
        NetconfNode nnode=(NetconfNode)entry.getValue();
        NetconfNodeFields.ConnectionStatus csts=nnode.getConnectionStatus();
switch (csts) {
case Connected:
{
            LOG.debug("String_Node_Str",nodeId.getValue());
            List<AvailableCapability> capabilities=nnode.getAvailableCapabilities().getAvailableCapability();
            LOG.debug("String_Node_Str",capabilities);
            if (isServiceFunction(nnode)) {
              DescriptionInfo descInfo=SfcNetconfServiceFunctionAPI.getServiceFunctionDescription(nodeName);
              String type=descInfo.getType();
              if (type == null || type.isEmpty()) {
                LOG.error("String_Node_Str");
                break;
              }
              SftTypeName sfType=SfcProviderServiceTypeAPI.readServiceFunctionType(new SftTypeName(type)).getType();
              if (sfType == null) {
                LOG.error("String_Node_Str",type);
                break;
              }
              SfName sfNodeName=new SfName(nodeName);
              ServiceFunction sf=SfcNetconfServiceFunctionAPI.buildServiceFunctionFromNetconf(sfNodeName,descInfo.getDataPlaneIp(),descInfo.getDataPlanePort(),sfType);
              if (SfcProviderServiceFunctionAPI.putServiceFunction(sf)) {
                LOG.info("String_Node_Str",nodeName);
                SfcNetconfServiceFunctionAPI.putServiceFunctionDescription(descInfo,sfNodeName);
                MonitoringInfo monInfo=SfcNetconfServiceFunctionAPI.getServiceFunctionMonitor(nodeName);
                if (monInfo != null) {
                  SfcNetconfServiceFunctionAPI.putServiceFunctionMonitor(monInfo,sfNodeName);
                }
              }
 else {
                LOG.error("String_Node_Str",nodeName);
              }
              SfDescriptionMonitoringThread monitoringThread=new SfDescriptionMonitoringThread(nodeName);
              Thread thread=new Thread(monitoringThread);
              thread.start();
            }
 else {
              ServiceFunctionForwarder sff=SfcNetconfServiceForwarderAPI.buildServiceForwarderFromNetconf(nodeName,nnode);
              if (SfcProviderServiceForwarderAPI.putServiceFunctionForwarder(sff)) {
                LOG.info("String_Node_Str",nodeName);
              }
 else {
                LOG.error("String_Node_Str",nodeName);
              }
            }
            break;
          }
case Connecting:
{
          LOG.info("String_Node_Str",nodeName);
          if (SfcProviderServiceForwarderAPI.deleteServiceFunctionForwarder(new SffName(nodeName))) {
            LOG.info("String_Node_Str",nodeName);
          }
 else {
            LOG.error("String_Node_Str",nodeName);
          }
          break;
        }
case UnableToConnect:
{
        LOG.info("String_Node_Str",nodeName);
        if (SfcProviderServiceForwarderAPI.deleteServiceFunctionForwarder(new SffName(nodeName))) {
          LOG.info("String_Node_Str",nodeName);
        }
 else {
          LOG.error("String_Node_Str",nodeName);
        }
        break;
      }
default :
    break;
}
}
}
}
printTraceStop(LOG);
}

Fixed version (ground truth):
@Override public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>,DataObject> change){
  printTraceStart(LOG);
  Map<InstanceIdentifier<?>,DataObject> dataCreatedObject=change.getCreatedData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataCreatedObject.entrySet()) {
    if (entry.getValue() instanceof Node) {
      Node node=(Node)entry.getValue();
      LOG.debug("String_Node_Str",node.toString());
    }
  }
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : change.getCreatedData().entrySet()) {
    if (entry.getKey().getTargetType() == NetconfNode.class) {
      NodeId nodeId=getNodeId(entry);
      String nodeName=nodeId.getValue();
      LOG.info("String_Node_Str",nodeName);
    }
  }
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : change.getUpdatedData().entrySet()) {
    if (entry.getKey().getTargetType() == NetconfNode.class && !dataCreatedObject.containsKey(entry.getKey())) {
      NodeId nodeId=getNodeId(entry);
      String nodeName=nodeId.getValue();
      if (!CONTROLLER_CONFIG.equals(nodeName)) {
        NetconfNode nnode=(NetconfNode)entry.getValue();
        NetconfNodeFields.ConnectionStatus csts=nnode.getConnectionStatus();
switch (csts) {
case Connected:
{
            LOG.debug("String_Node_Str",nodeId.getValue());
            List<AvailableCapability> capabilities=nnode.getAvailableCapabilities().getAvailableCapability();
            LOG.debug("String_Node_Str",capabilities);
            if (isServiceFunction(nnode)) {
              DescriptionInfo descInfo=SfcNetconfServiceFunctionAPI.getServiceFunctionDescription(nodeName);
              String type=descInfo.getType();
              if (type == null || type.isEmpty()) {
                LOG.error("String_Node_Str");
                break;
              }
              SftTypeName sfType=SfcProviderServiceTypeAPI.readServiceFunctionType(new SftTypeName(type)).getType();
              if (sfType == null) {
                LOG.error("String_Node_Str",type);
                break;
              }
              SfName sfNodeName=new SfName(nodeName);
              ServiceFunction sf=SfcNetconfServiceFunctionAPI.buildServiceFunctionFromNetconf(sfNodeName,descInfo.getDataPlaneIp(),descInfo.getDataPlanePort(),sfType);
              if (SfcProviderServiceFunctionAPI.putServiceFunction(sf)) {
                LOG.info("String_Node_Str",nodeName);
                SfcNetconfServiceFunctionAPI.putServiceFunctionDescription(descInfo,sfNodeName);
                MonitoringInfo monInfo=SfcNetconfServiceFunctionAPI.getServiceFunctionMonitor(nodeName);
                if (monInfo != null) {
                  SfcNetconfServiceFunctionAPI.putServiceFunctionMonitor(monInfo,sfNodeName);
                }
              }
 else {
                LOG.error("String_Node_Str",nodeName);
              }
              SfDescriptionMonitoringThread monitoringThread=new SfDescriptionMonitoringThread(nodeName);
              Thread thread=new Thread(monitoringThread);
              thread.start();
            }
 else {
              ServiceFunctionForwarder sff=SfcNetconfServiceForwarderAPI.buildServiceForwarderFromNetconf(nodeName,nnode);
              if (SfcProviderServiceForwarderAPI.putServiceFunctionForwarder(sff)) {
                LOG.info("String_Node_Str",nodeName);
              }
 else {
                LOG.error("String_Node_Str",nodeName);
              }
            }
            break;
          }
case Connecting:
{
          LOG.info("String_Node_Str",nodeName);
          if (SfcProviderServiceForwarderAPI.deleteServiceFunctionForwarder(new SffName(nodeName))) {
            LOG.info("String_Node_Str",nodeName);
          }
 else {
            LOG.error("String_Node_Str",nodeName);
          }
          break;
        }
case UnableToConnect:
{
        LOG.info("String_Node_Str",nodeName);
        if (SfcProviderServiceForwarderAPI.deleteServiceFunctionForwarder(new SffName(nodeName))) {
          LOG.info("String_Node_Str",nodeName);
        }
 else {
          LOG.error("String_Node_Str",nodeName);
        }
        break;
      }
default :
    break;
}
}
}
}
printTraceStop(LOG);
}