Program: 132049
Project: 132049
Buggy source:
/** 
 * Put the service function monitor information into the OPERATIONAL datastore.
 * @param monInfo Service Function monitoring information
 * @param sfName Service Function name
 * @return true if monInfo was successfully put, fasle otherwise
 */
public static boolean putServiceFunctionMonitor(MonitoringInfo monInfo,SfName sfName){
  boolean ret=false;
  SfcSfDescMonBuilder sfDescMonBuilder=null;
  SfcSfDescMon sfDescMon=null;
  ServiceFunctionState dataSfcStateObject;
  printTraceStart(LOG);
  if (dataBroker != null) {
    sfDescMonBuilder=new SfcSfDescMonBuilder().setMonitoringInfo(monInfo);
    ServiceFunctionStateKey serviceFunctionStateKey=new ServiceFunctionStateKey(sfName);
    InstanceIdentifier<ServiceFunctionState> sfStateIID=InstanceIdentifier.builder(ServiceFunctionsState.class).child(ServiceFunctionState.class,serviceFunctionStateKey).build();
    dataSfcStateObject=SfcDataStoreAPI.readTransactionAPI(sfStateIID,LogicalDatastoreType.OPERATIONAL);
    if (dataSfcStateObject != null) {
      ServiceFunctionState1 sf1Temp=dataSfcStateObject.getAugmentation(ServiceFunctionState1.class);
      if (sf1Temp != null) {
        SfcSfDescMon sfDescMonTemp=sf1Temp.getSfcSfDescMon();
        sfDescMonBuilder.setDescriptionInfo(sfDescMonTemp.getDescriptionInfo());
      }
    }
    sfDescMon=sfDescMonBuilder.build();
    ServiceFunctionState1 sfState1=new ServiceFunctionState1Builder().setSfcSfDescMon(sfDescMon).build();
    ServiceFunctionState serviceFunctionState=new ServiceFunctionStateBuilder().setKey(serviceFunctionStateKey).addAugmentation(ServiceFunctionState1.class,sfState1).build();
    if (dataSfcStateObject != null) {
      ret=SfcProviderServiceFunctionAPI.mergeServiceFunctionState(serviceFunctionState);
    }
 else {
      ret=SfcProviderServiceFunctionAPI.putServiceFunctionState(serviceFunctionState);
    }
  }
 else {
    LOG.error("String_Node_Str");
  }
  printTraceStop(LOG);
  return ret;
}

Fixed version (ground truth):
/** 
 * Put the service function monitor information into the OPERATIONAL datastore.
 * @param monInfo Service Function monitoring information
 * @param sfName Service Function name
 * @return true if monInfo was successfully put, fasle otherwise
 */
public static boolean putServiceFunctionMonitor(MonitoringInfo monInfo,SfName sfName){
  boolean ret=false;
  SfcSfDescMonBuilder sfDescMonBuilder;
  SfcSfDescMon sfDescMon;
  ServiceFunctionState dataSfcStateObject;
  printTraceStart(LOG);
  if (dataBroker != null) {
    sfDescMonBuilder=new SfcSfDescMonBuilder().setMonitoringInfo(monInfo);
    ServiceFunctionStateKey serviceFunctionStateKey=new ServiceFunctionStateKey(sfName);
    InstanceIdentifier<ServiceFunctionState> sfStateIID=InstanceIdentifier.builder(ServiceFunctionsState.class).child(ServiceFunctionState.class,serviceFunctionStateKey).build();
    dataSfcStateObject=SfcDataStoreAPI.readTransactionAPI(sfStateIID,LogicalDatastoreType.OPERATIONAL);
    if (dataSfcStateObject != null) {
      ServiceFunctionState1 sf1Temp=dataSfcStateObject.getAugmentation(ServiceFunctionState1.class);
      if (sf1Temp != null) {
        SfcSfDescMon sfDescMonTemp=sf1Temp.getSfcSfDescMon();
        sfDescMonBuilder.setDescriptionInfo(sfDescMonTemp.getDescriptionInfo());
      }
    }
    sfDescMon=sfDescMonBuilder.build();
    ServiceFunctionState1 sfState1=new ServiceFunctionState1Builder().setSfcSfDescMon(sfDescMon).build();
    ServiceFunctionState serviceFunctionState=new ServiceFunctionStateBuilder().setKey(serviceFunctionStateKey).addAugmentation(ServiceFunctionState1.class,sfState1).build();
    if (dataSfcStateObject != null) {
      ret=SfcProviderServiceFunctionAPI.mergeServiceFunctionState(serviceFunctionState);
    }
 else {
      ret=SfcProviderServiceFunctionAPI.putServiceFunctionState(serviceFunctionState);
    }
  }
 else {
    LOG.error("String_Node_Str");
  }
  printTraceStop(LOG);
  return ret;
}