Program: 132152
Project: 132152
Buggy source:
/** 
 * Create a Rendered Path and all the associated operational state based on the given rendered service path <p>
 * @param serviceFunctionPath RSP Object
 * @return Nothing.
 */
protected RenderedServicePath createRenderedServicePathEntry(ServiceFunctionPath serviceFunctionPath,CreateRenderedPathInput createRenderedPathInput){
  printTraceStart(LOG);
  long pathId;
  int serviceIndex;
  RenderedServicePath ret=null;
  ServiceFunctionChain serviceFunctionChain;
  String serviceFunctionChainName=serviceFunctionPath.getServiceChainName();
  serviceFunctionChain=serviceFunctionChainName != null ? SfcProviderServiceChainAPI.readServiceFunctionChain(serviceFunctionChainName) : null;
  if (serviceFunctionChain == null) {
    LOG.error("String_Node_Str",serviceFunctionPath.getName());
    return ret;
  }
  RenderedServicePathBuilder renderedServicePathBuilder=new RenderedServicePathBuilder();
  serviceIndex=MAX_STARTING_INDEX;
  List<String> sfgNameList=getSfgNameList(serviceFunctionChain);
  List<String> sfNameList=scheduler.scheduleServiceFuntions(serviceFunctionChain,serviceIndex);
  if (sfNameList == null && sfgNameList == null) {
    LOG.warn("String_Node_Str");
    return null;
  }
  List<RenderedServicePathHop> renderedServicePathHopArrayList=createRenderedServicePathHopList(sfNameList,sfgNameList,serviceIndex);
  if (renderedServicePathHopArrayList == null) {
    LOG.warn("String_Node_Str");
    return null;
  }
  pathId=(serviceFunctionPath.getPathId() != null) ? serviceFunctionPath.getPathId() : numCreatedPathIncrementGet();
  renderedServicePathBuilder.setRenderedServicePathHop(renderedServicePathHopArrayList);
  if (createRenderedPathInput.getName() == null || createRenderedPathInput.getName().isEmpty()) {
    renderedServicePathBuilder.setName(serviceFunctionPath.getName() + "String_Node_Str" + pathId);
  }
 else {
    renderedServicePathBuilder.setName(createRenderedPathInput.getName());
  }
  renderedServicePathBuilder.setPathId(pathId);
  renderedServicePathBuilder.setStartingIndex((short)MAX_STARTING_INDEX);
  renderedServicePathBuilder.setServiceChainName(serviceFunctionChainName);
  renderedServicePathBuilder.setParentServiceFunctionPath(serviceFunctionPath.getName());
  if (serviceFunctionPath.getTransportType() == null) {
    renderedServicePathBuilder.setTransportType(VxlanGpe.class);
  }
 else {
    renderedServicePathBuilder.setTransportType(serviceFunctionPath.getTransportType());
  }
  RenderedServicePathKey renderedServicePathKey=new RenderedServicePathKey(renderedServicePathBuilder.getName());
  InstanceIdentifier<RenderedServicePath> rspIID;
  rspIID=InstanceIdentifier.builder(RenderedServicePaths.class).child(RenderedServicePath.class,renderedServicePathKey).build();
  RenderedServicePath renderedServicePath=renderedServicePathBuilder.build();
  if (SfcDataStoreAPI.writeMergeTransactionAPI(rspIID,renderedServicePath,LogicalDatastoreType.OPERATIONAL)) {
    ret=renderedServicePath;
  }
 else {
    LOG.error("String_Node_Str",Thread.currentThread().getStackTrace()[1],serviceFunctionPath.getName());
  }
  printTraceStop(LOG);
  return ret;
}

Fixed version (ground truth):
/** 
 * Create a Rendered Path and all the associated operational state based on the given rendered service path <p>
 * @param serviceFunctionPath RSP Object
 * @return Nothing.
 */
protected RenderedServicePath createRenderedServicePathEntry(ServiceFunctionPath serviceFunctionPath,CreateRenderedPathInput createRenderedPathInput){
  printTraceStart(LOG);
  long pathId;
  int serviceIndex;
  RenderedServicePath ret=null;
  ServiceFunctionChain serviceFunctionChain;
  String serviceFunctionChainName=serviceFunctionPath.getServiceChainName();
  serviceFunctionChain=serviceFunctionChainName != null ? SfcProviderServiceChainAPI.readServiceFunctionChain(serviceFunctionChainName) : null;
  if (serviceFunctionChain == null) {
    LOG.error("String_Node_Str",serviceFunctionPath.getName());
    return ret;
  }
  RenderedServicePathBuilder renderedServicePathBuilder=new RenderedServicePathBuilder();
  serviceIndex=MAX_STARTING_INDEX;
  List<String> sfgNameList=getSfgNameList(serviceFunctionChain);
  List<String> sfNameList=scheduler.scheduleServiceFunctions(serviceFunctionChain,serviceIndex);
  if (sfNameList == null && sfgNameList == null) {
    LOG.warn("String_Node_Str");
    return null;
  }
  List<RenderedServicePathHop> renderedServicePathHopArrayList=createRenderedServicePathHopList(sfNameList,sfgNameList,serviceIndex);
  if (renderedServicePathHopArrayList == null) {
    LOG.warn("String_Node_Str");
    return null;
  }
  pathId=(serviceFunctionPath.getPathId() != null) ? serviceFunctionPath.getPathId() : numCreatedPathIncrementGet();
  renderedServicePathBuilder.setRenderedServicePathHop(renderedServicePathHopArrayList);
  if (createRenderedPathInput.getName() == null || createRenderedPathInput.getName().isEmpty()) {
    renderedServicePathBuilder.setName(serviceFunctionPath.getName() + "String_Node_Str" + pathId);
  }
 else {
    renderedServicePathBuilder.setName(createRenderedPathInput.getName());
  }
  renderedServicePathBuilder.setPathId(pathId);
  renderedServicePathBuilder.setStartingIndex((short)MAX_STARTING_INDEX);
  renderedServicePathBuilder.setServiceChainName(serviceFunctionChainName);
  renderedServicePathBuilder.setParentServiceFunctionPath(serviceFunctionPath.getName());
  if (serviceFunctionPath.getTransportType() == null) {
    renderedServicePathBuilder.setTransportType(VxlanGpe.class);
  }
 else {
    renderedServicePathBuilder.setTransportType(serviceFunctionPath.getTransportType());
  }
  RenderedServicePathKey renderedServicePathKey=new RenderedServicePathKey(renderedServicePathBuilder.getName());
  InstanceIdentifier<RenderedServicePath> rspIID;
  rspIID=InstanceIdentifier.builder(RenderedServicePaths.class).child(RenderedServicePath.class,renderedServicePathKey).build();
  RenderedServicePath renderedServicePath=renderedServicePathBuilder.build();
  if (SfcDataStoreAPI.writeMergeTransactionAPI(rspIID,renderedServicePath,LogicalDatastoreType.OPERATIONAL)) {
    ret=renderedServicePath;
  }
 else {
    LOG.error("String_Node_Str",Thread.currentThread().getStackTrace()[1],serviceFunctionPath.getName());
  }
  printTraceStop(LOG);
  return ret;
}