Program: 132117
Project: 132117
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 ServiceFunctionForwarder) {
      ServiceFunctionForwarder serviceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
      LOG.debug("String_Node_Str",serviceFunctionForwarder.toString());
      OvsdbBridgeAugmentation ovsdbBridge=SfcSffToOvsMappingAPI.buildOvsdbBridgeAugmentation(serviceFunctionForwarder,opendaylightSfc.getExecutor());
      if (ovsdbBridge != null) {
        SfcOvsUtil.putOvsdbBridge(ovsdbBridge,opendaylightSfc.getExecutor());
        SfcOvsUtil.putOvsdbTerminationPoints(ovsdbBridge,serviceFunctionForwarder.getSffDataPlaneLocator(),opendaylightSfc.getExecutor());
      }
    }
  }
  Map<InstanceIdentifier<?>,DataObject> dataUpdatedObject=change.getUpdatedData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataUpdatedObject.entrySet()) {
    if ((entry.getValue() instanceof ServiceFunctionForwarder) && (!dataCreatedObject.containsKey(entry.getKey()))) {
      ServiceFunctionForwarder updatedServiceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
      LOG.debug("String_Node_Str",updatedServiceFunctionForwarder.toString());
      OvsdbBridgeAugmentation ovsdbBridge=SfcSffToOvsMappingAPI.buildOvsdbBridgeAugmentation(updatedServiceFunctionForwarder,opendaylightSfc.getExecutor());
      if (ovsdbBridge != null) {
        SfcOvsUtil.putOvsdbBridge(ovsdbBridge,opendaylightSfc.getExecutor());
        SfcOvsUtil.putOvsdbTerminationPoints(ovsdbBridge,updatedServiceFunctionForwarder.getSffDataPlaneLocator(),opendaylightSfc.getExecutor());
      }
    }
  }
  Set<InstanceIdentifier<?>> dataRemovedConfigurationIID=change.getRemovedPaths();
  for (  InstanceIdentifier instanceIdentifier : dataRemovedConfigurationIID) {
    DataObject dataObject=dataOriginalDataObject.get(instanceIdentifier);
    if (dataObject instanceof ServiceFunctionForwarder) {
      ServiceFunctionForwarder deletedServiceFunctionForwarder=(ServiceFunctionForwarder)dataObject;
      LOG.debug("String_Node_Str",deletedServiceFunctionForwarder.toString());
      KeyedInstanceIdentifier keyedInstanceIdentifier=(KeyedInstanceIdentifier)instanceIdentifier.firstIdentifierOf(ServiceFunctionForwarder.class);
      if (keyedInstanceIdentifier != null) {
        ServiceFunctionForwarderKey sffKey=(ServiceFunctionForwarderKey)keyedInstanceIdentifier.getKey();
        String sffName=sffKey.getName();
        SfcOvsUtil.deleteOvsdbNode(SfcOvsUtil.buildOvsdbNodeIID(sffName),opendaylightSfc.getExecutor());
      }
    }
 else     if (dataObject instanceof SffDataPlaneLocator) {
      SffDataPlaneLocator sffDataPlaneLocator=(SffDataPlaneLocator)dataObject;
      LOG.debug("String_Node_Str",sffDataPlaneLocator.getName());
      KeyedInstanceIdentifier keyedInstanceIdentifier=(KeyedInstanceIdentifier)instanceIdentifier.firstIdentifierOf(ServiceFunctionForwarder.class);
      if (keyedInstanceIdentifier != null) {
        ServiceFunctionForwarderKey sffKey=(ServiceFunctionForwarderKey)keyedInstanceIdentifier.getKey();
        String sffName=sffKey.getName();
        SfcOvsUtil.deleteOvsdbTerminationPoint(SfcOvsUtil.buildOvsdbTerminationPointIID(sffName,sffDataPlaneLocator.getName()),opendaylightSfc.getExecutor());
      }
    }
  }
  printTraceStop(LOG);
}

Fixed version (ground truth):
@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 ServiceFunctionForwarder) {
      ServiceFunctionForwarder serviceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
      LOG.debug("String_Node_Str",serviceFunctionForwarder.toString());
      addOvsdbAugmentations(serviceFunctionForwarder,opendaylightSfc.getExecutor());
    }
  }
  Map<InstanceIdentifier<?>,DataObject> dataUpdatedObject=change.getUpdatedData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataUpdatedObject.entrySet()) {
    if ((entry.getValue() instanceof ServiceFunctionForwarder) && (!dataCreatedObject.containsKey(entry.getKey()))) {
      ServiceFunctionForwarder updatedServiceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
      LOG.debug("String_Node_Str",updatedServiceFunctionForwarder.toString());
      addOvsdbAugmentations(updatedServiceFunctionForwarder,opendaylightSfc.getExecutor());
    }
  }
  Set<InstanceIdentifier<?>> dataRemovedConfigurationIID=change.getRemovedPaths();
  for (  InstanceIdentifier instanceIdentifier : dataRemovedConfigurationIID) {
    DataObject dataObject=dataOriginalDataObject.get(instanceIdentifier);
    if (dataObject instanceof ServiceFunctionForwarder) {
      ServiceFunctionForwarder deletedServiceFunctionForwarder=(ServiceFunctionForwarder)dataObject;
      LOG.debug("String_Node_Str",deletedServiceFunctionForwarder.toString());
      KeyedInstanceIdentifier keyedInstanceIdentifier=(KeyedInstanceIdentifier)instanceIdentifier.firstIdentifierOf(ServiceFunctionForwarder.class);
      if (keyedInstanceIdentifier != null) {
        ServiceFunctionForwarderKey sffKey=(ServiceFunctionForwarderKey)keyedInstanceIdentifier.getKey();
        String sffName=sffKey.getName();
        SfcOvsUtil.deleteOvsdbNode(SfcOvsUtil.buildOvsdbNodeIID(sffName),opendaylightSfc.getExecutor());
      }
    }
 else     if (dataObject instanceof SffDataPlaneLocator) {
      SffDataPlaneLocator sffDataPlaneLocator=(SffDataPlaneLocator)dataObject;
      LOG.debug("String_Node_Str",sffDataPlaneLocator.getName());
      KeyedInstanceIdentifier keyedInstanceIdentifier=(KeyedInstanceIdentifier)instanceIdentifier.firstIdentifierOf(ServiceFunctionForwarder.class);
      if (keyedInstanceIdentifier != null) {
        ServiceFunctionForwarderKey sffKey=(ServiceFunctionForwarderKey)keyedInstanceIdentifier.getKey();
        String sffName=sffKey.getName();
        SfcOvsUtil.deleteOvsdbTerminationPoint(SfcOvsUtil.buildOvsdbTerminationPointIID(sffName,sffDataPlaneLocator.getName()),opendaylightSfc.getExecutor());
      }
    }
  }
  printTraceStop(LOG);
}