Program: 132182
Project: 132182
Buggy source:
@Override public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>,DataObject> change){
  printTraceStart(LOG);
  odlSfc.getLock();
  Map<InstanceIdentifier<?>,DataObject> dataOriginalDataObject=change.getOriginalData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataOriginalDataObject.entrySet()) {
    if (entry.getValue() instanceof ServiceFunctionForwarder) {
      ServiceFunctionForwarder originalServiceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
    }
  }
  Set<InstanceIdentifier<?>> dataRemovedConfigurationIID=change.getRemovedPaths();
  for (  InstanceIdentifier instanceIdentifier : dataRemovedConfigurationIID) {
    DataObject dataObject=dataOriginalDataObject.get(instanceIdentifier);
    if (dataObject instanceof ServiceFunctionForwarder) {
      ServiceFunctionForwarder serviceFunctionForwarder=(ServiceFunctionForwarder)dataObject;
      String sffName=serviceFunctionForwarder.getName();
      List<String> rspList=new ArrayList<>();
      List<SffServicePath> sffServicePathList=SfcProviderServiceForwarderAPI.readSffStateExecutor(sffName);
      if ((sffServicePathList != null) && !sffServicePathList.isEmpty()) {
        if (SfcProviderServiceForwarderAPI.deleteServiceFunctionForwarderStateExecutor(sffName)) {
        }
 else {
          LOG.error("String_Node_Str",Thread.currentThread().getStackTrace()[1],sffName);
        }
        for (        SffServicePath sffServicePath : sffServicePathList) {
          String rspName=sffServicePath.getName();
          SfcProviderServiceFunctionAPI.deleteServicePathFromServiceFunctionStateExecutor(rspName);
          rspList.add(rspName);
        }
        SfcProviderServicePathAPI.deleteRenderedServicePathsExecutor(rspList);
      }
      Object[] serviceForwarderObj={serviceFunctionForwarder};
      Class[] serviceForwarderClass={ServiceFunctionForwarder.class};
      SfcProviderRestAPI sfcProviderRestAPI=SfcProviderRestAPI.getDeleteServiceFunctionForwarder(serviceForwarderObj,serviceForwarderClass);
      odlSfc.executor.submit(sfcProviderRestAPI);
    }
  }
  Map<InstanceIdentifier<?>,DataObject> dataCreatedObject=change.getCreatedData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataCreatedObject.entrySet()) {
    if (entry.getValue() instanceof ServiceFunctionForwarder) {
      ServiceFunctionForwarder createdServiceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
      Object[] serviceForwarderObj={createdServiceFunctionForwarder};
      Class[] serviceForwarderClass={ServiceFunctionForwarder.class};
      SfcProviderServiceForwarderAPI sfcProviderServiceForwarderAPI=SfcProviderServiceForwarderAPI.getCheckServiceForwarderAPI(serviceForwarderObj,serviceForwarderClass);
      odlSfc.executor.submit(sfcProviderServiceForwarderAPI);
    }
  }
  Map<InstanceIdentifier<?>,DataObject> dataUpdatedConfigurationObject=change.getUpdatedData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataUpdatedConfigurationObject.entrySet()) {
    if ((entry.getValue() instanceof ServiceFunctionForwarder) && (!(dataCreatedObject.containsKey(entry.getKey())))) {
      ServiceFunctionForwarder serviceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
      String sffName=serviceFunctionForwarder.getName();
      SfcProviderServiceForwarderAPI.deleteServiceFunctionForwarderStateExecutor(sffName);
      List<String> rspList=new ArrayList<>();
      List<SffServicePath> sffServicePathList=SfcProviderServiceForwarderAPI.readSffStateExecutor(sffName);
      if ((sffServicePathList != null) && !sffServicePathList.isEmpty()) {
        for (        SffServicePath sffServicePath : sffServicePathList) {
          String rspName=sffServicePath.getName();
          SfcProviderServiceFunctionAPI.deleteServicePathFromServiceFunctionStateExecutor(rspName);
          rspList.add(rspName);
        }
        SfcProviderServicePathAPI.deleteRenderedServicePathsExecutor(rspList);
      }
      Object[] serviceForwarderObj={serviceFunctionForwarder};
      Class[] serviceForwarderClass={ServiceFunctionForwarder.class};
      SfcProviderServiceForwarderAPI sfcProviderServiceForwarderAPI=SfcProviderServiceForwarderAPI.getCheckServiceForwarderAPI(serviceForwarderObj,serviceForwarderClass);
      odlSfc.executor.submit(sfcProviderServiceForwarderAPI);
    }
  }
  odlSfc.releaseLock();
  printTraceStop(LOG);
}

Fixed version (ground truth):
@Override public void onDataChanged(final AsyncDataChangeEvent<InstanceIdentifier<?>,DataObject> change){
  printTraceStart(LOG);
  ODL_SFC.getLock();
  Map<InstanceIdentifier<?>,DataObject> dataOriginalDataObject=change.getOriginalData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataOriginalDataObject.entrySet()) {
    if (entry.getValue() instanceof ServiceFunctionForwarder) {
      ServiceFunctionForwarder originalServiceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
    }
  }
  Set<InstanceIdentifier<?>> dataRemovedConfigurationIID=change.getRemovedPaths();
  for (  InstanceIdentifier instanceIdentifier : dataRemovedConfigurationIID) {
    DataObject dataObject=dataOriginalDataObject.get(instanceIdentifier);
    if (dataObject instanceof ServiceFunctionForwarder) {
      ServiceFunctionForwarder serviceFunctionForwarder=(ServiceFunctionForwarder)dataObject;
      String sffName=serviceFunctionForwarder.getName();
      List<String> rspList=new ArrayList<>();
      List<SffServicePath> sffServicePathList=SfcProviderServiceForwarderAPI.readSffStateExecutor(sffName);
      if ((sffServicePathList != null) && !sffServicePathList.isEmpty()) {
        if (SfcProviderServiceForwarderAPI.deleteServiceFunctionForwarderStateExecutor(sffName)) {
        }
 else {
          LOG.error("String_Node_Str",Thread.currentThread().getStackTrace()[1],sffName);
        }
        for (        SffServicePath sffServicePath : sffServicePathList) {
          String rspName=sffServicePath.getName();
          SfcProviderServiceFunctionAPI.deleteServicePathFromServiceFunctionStateExecutor(rspName);
          rspList.add(rspName);
        }
        SfcProviderServicePathAPI.deleteRenderedServicePathsExecutor(rspList);
      }
      Object[] serviceForwarderObj={serviceFunctionForwarder};
      Class[] serviceForwarderClass={ServiceFunctionForwarder.class};
      SfcProviderRestAPI sfcProviderRestAPI=SfcProviderRestAPI.getDeleteServiceFunctionForwarder(serviceForwarderObj,serviceForwarderClass);
      ODL_SFC.getExecutor().submit(sfcProviderRestAPI);
    }
  }
  Map<InstanceIdentifier<?>,DataObject> dataCreatedObject=change.getCreatedData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataCreatedObject.entrySet()) {
    if (entry.getValue() instanceof ServiceFunctionForwarder) {
      ServiceFunctionForwarder createdServiceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
      Object[] serviceForwarderObj={createdServiceFunctionForwarder};
      Class[] serviceForwarderClass={ServiceFunctionForwarder.class};
      SfcProviderServiceForwarderAPI sfcProviderServiceForwarderAPI=SfcProviderServiceForwarderAPI.getCheckServiceForwarderAPI(serviceForwarderObj,serviceForwarderClass);
      ODL_SFC.getExecutor().submit(sfcProviderServiceForwarderAPI);
    }
  }
  Map<InstanceIdentifier<?>,DataObject> dataUpdatedConfigurationObject=change.getUpdatedData();
  for (  Map.Entry<InstanceIdentifier<?>,DataObject> entry : dataUpdatedConfigurationObject.entrySet()) {
    if ((entry.getValue() instanceof ServiceFunctionForwarder) && (!(dataCreatedObject.containsKey(entry.getKey())))) {
      ServiceFunctionForwarder serviceFunctionForwarder=(ServiceFunctionForwarder)entry.getValue();
      String sffName=serviceFunctionForwarder.getName();
      SfcProviderServiceForwarderAPI.deleteServiceFunctionForwarderStateExecutor(sffName);
      List<String> rspList=new ArrayList<>();
      List<SffServicePath> sffServicePathList=SfcProviderServiceForwarderAPI.readSffStateExecutor(sffName);
      if ((sffServicePathList != null) && !sffServicePathList.isEmpty()) {
        for (        SffServicePath sffServicePath : sffServicePathList) {
          String rspName=sffServicePath.getName();
          SfcProviderServiceFunctionAPI.deleteServicePathFromServiceFunctionStateExecutor(rspName);
          rspList.add(rspName);
        }
        SfcProviderServicePathAPI.deleteRenderedServicePathsExecutor(rspList);
      }
      Object[] serviceForwarderObj={serviceFunctionForwarder};
      Class[] serviceForwarderClass={ServiceFunctionForwarder.class};
      SfcProviderServiceForwarderAPI sfcProviderServiceForwarderAPI=SfcProviderServiceForwarderAPI.getCheckServiceForwarderAPI(serviceForwarderObj,serviceForwarderClass);
      ODL_SFC.getExecutor().submit(sfcProviderServiceForwarderAPI);
    }
  }
  ODL_SFC.releaseLock();
  printTraceStop(LOG);
}