Program: 132050
Project: 132050
Buggy source:
/** 
 * put the service function description information into the OPERATIONAL datastore.
 * @param descInfo Service Function description information
 * @param sfName Service Function name
 * @return true if descInfo was successfully put, false otherwise
 */
public static boolean putServiceFunctionDescription(DescriptionInfo descInfo,SfName sfName){
  boolean ret=false;
  SfcSfDescMonBuilder sfDescMonBuilder=null;
  SfcSfDescMon sfDescMon=null;
  ServiceFunctionState dataSfcStateObject;
  printTraceStart(LOG);
  if (dataBroker != null) {
    sfDescMonBuilder=new SfcSfDescMonBuilder().setDescriptionInfo(descInfo);
    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.setMonitoringInfo(sfDescMonTemp.getMonitoringInfo());
      }
    }
    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 description information into the OPERATIONAL datastore.
 * @param descInfo Service Function description information
 * @param sfName Service Function name
 * @return true if descInfo was successfully put, false otherwise
 */
public static boolean putServiceFunctionDescription(DescriptionInfo descInfo,SfName sfName){
  boolean ret=false;
  SfcSfDescMonBuilder sfDescMonBuilder;
  SfcSfDescMon sfDescMon;
  ServiceFunctionState dataSfcStateObject;
  printTraceStart(LOG);
  if (dataBroker != null) {
    sfDescMonBuilder=new SfcSfDescMonBuilder().setDescriptionInfo(descInfo);
    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.setMonitoringInfo(sfDescMonTemp.getMonitoringInfo());
      }
    }
    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;
}