Program: 132149
Project: 132149
Buggy source:
@Before public void before() throws ExecutionException, InterruptedException {
  dataBroker=getDataBroker();
  opendaylightSfc.setDataProvider(dataBroker);
  executor=opendaylightSfc.getExecutor();
  executor.submit(SfcProviderServiceFunctionAPI.getDeleteAll(new Object[]{},new Class[]{}));
  executor.submit(SfcProviderServiceForwarderAPI.getDeleteAll(new Object[]{},new Class[]{}));
  executor.submit(SfcProviderServiceTypeAPI.getDeleteAll(new Object[]{},new Class[]{}));
  executor.submit(SfcProviderServiceChainAPI.getDeleteAll(new Object[]{},new Class[]{}));
  executor.submit(SfcProviderServicePathAPI.getDeleteAll(new Object[]{},new Class[]{}));
  final String[] sfNames={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  final IpAddress[] ipMgmtAddress=new IpAddress[sfNames.length];
  final IpAddress[] locatorIpAddress=new IpAddress[sfNames.length];
  SfDataPlaneLocator[] sfDataPlaneLocator=new SfDataPlaneLocator[sfNames.length];
  ServiceFunctionKey[] key=new ServiceFunctionKey[sfNames.length];
  for (int i=0; i < sfNames.length; i++) {
    ipMgmtAddress[i]=new IpAddress(new Ipv4Address(IP_MGMT_ADDRESS[0]));
    locatorIpAddress[i]=new IpAddress(new Ipv4Address(LOCATOR_IP_ADDRESS[0]));
    PortNumber portNumber=new PortNumber(PORT[i]);
    key[i]=new ServiceFunctionKey(sfNames[i]);
    IpBuilder ipBuilder=new IpBuilder();
    ipBuilder.setIp(locatorIpAddress[i]).setPort(portNumber);
    SfDataPlaneLocatorBuilder locatorBuilder=new SfDataPlaneLocatorBuilder();
    locatorBuilder.setName(LOCATOR_IP_ADDRESS[i]).setLocatorType(ipBuilder.build()).setServiceFunctionForwarder(SFF_NAMES[i]);
    sfDataPlaneLocator[i]=locatorBuilder.build();
    ServiceFunctionBuilder sfBuilder=new ServiceFunctionBuilder();
    List<SfDataPlaneLocator> dataPlaneLocatorList=new ArrayList<>();
    dataPlaneLocatorList.add(sfDataPlaneLocator[i]);
    sfBuilder.setName(sfNames[i]).setKey(key[i]).setType(sfTypes[i]).setIpMgmtAddress(ipMgmtAddress[i]).setSfDataPlaneLocator(dataPlaneLocatorList);
    sfList.add(sfBuilder.build());
  }
  ServiceFunctionsBuilder sfsBuilder=new ServiceFunctionsBuilder();
  sfsBuilder.setServiceFunction(sfList);
  executor.submit(SfcProviderServiceFunctionAPI.getPutAll(new Object[]{sfsBuilder.build()},new Class[]{ServiceFunctions.class})).get();
  for (  ServiceFunction serviceFunction : sfList) {
    boolean ret=SfcProviderServiceTypeAPI.createServiceFunctionTypeEntryExecutor(serviceFunction);
    LOG.debug("String_Node_Str",serviceFunction.getName());
    assertTrue("String_Node_Str",ret);
  }
  for (int i=0; i < SFF_NAMES.length; i++) {
    List<ConnectedSffDictionary> sffDictionaryList=new ArrayList<>();
    for (int j=0; j < 2; j++) {
      ConnectedSffDictionaryBuilder sffDictionaryEntryBuilder=new ConnectedSffDictionaryBuilder();
      ConnectedSffDictionary sffDictEntry=sffDictionaryEntryBuilder.setName(TO_SFF_NAMES[i][j]).build();
      sffDictionaryList.add(sffDictEntry);
    }
    List<ServiceFunctionDictionary> sfDictionaryList=new ArrayList<>();
    ServiceFunction serviceFunction=sfList.get(i);
    SfDataPlaneLocator sfDPLocator=serviceFunction.getSfDataPlaneLocator().get(0);
    SffSfDataPlaneLocatorBuilder sffSfDataPlaneLocatorBuilder=new SffSfDataPlaneLocatorBuilder(sfDPLocator);
    SffSfDataPlaneLocator sffSfDataPlaneLocator=sffSfDataPlaneLocatorBuilder.build();
    ServiceFunctionDictionaryBuilder dictionaryEntryBuilder=new ServiceFunctionDictionaryBuilder();
    dictionaryEntryBuilder.setName(serviceFunction.getName()).setKey(new ServiceFunctionDictionaryKey(serviceFunction.getName())).setType(serviceFunction.getType()).setSffSfDataPlaneLocator(sffSfDataPlaneLocator).setFailmode(Open.class).setSffInterfaces(null);
    ServiceFunctionDictionary sfDictEntry=dictionaryEntryBuilder.build();
    sfDictionaryList.add(sfDictEntry);
    List<SffDataPlaneLocator> locatorList=new ArrayList<>();
    IpBuilder ipBuilder=new IpBuilder();
    ipBuilder.setIp(new IpAddress(new Ipv4Address(SFF_LOCATOR_IP[i]))).setPort(new PortNumber(PORT[i]));
    DataPlaneLocatorBuilder sffLocatorBuilder=new DataPlaneLocatorBuilder();
    sffLocatorBuilder.setLocatorType(ipBuilder.build()).setTransport(VxlanGpe.class);
    SffDataPlaneLocatorBuilder locatorBuilder=new SffDataPlaneLocatorBuilder();
    locatorBuilder.setName(SFF_LOCATOR_IP[i]).setKey(new SffDataPlaneLocatorKey(SFF_LOCATOR_IP[i])).setDataPlaneLocator(sffLocatorBuilder.build());
    locatorList.add(locatorBuilder.build());
    ServiceFunctionForwarderBuilder sffBuilder=new ServiceFunctionForwarderBuilder();
    sffBuilder.setName(SFF_NAMES[i]).setKey(new ServiceFunctionForwarderKey(SFF_NAMES[i])).setSffDataPlaneLocator(locatorList).setServiceFunctionDictionary(sfDictionaryList).setConnectedSffDictionary(sffDictionaryList).setServiceNode(null);
    ServiceFunctionForwarder sff=sffBuilder.build();
    executor.submit(SfcProviderServiceForwarderAPI.getPut(new Object[]{sff},new Class[]{ServiceFunctionForwarder.class})).get();
  }
}

Fixed version (ground truth):
@Before public void before() throws ExecutionException, InterruptedException {
  dataBroker=getDataBroker();
  opendaylightSfc.setDataProvider(dataBroker);
  executor=opendaylightSfc.getExecutor();
  executor.submit(SfcProviderServiceFunctionAPI.getDeleteAll(new Object[]{},new Class[]{}));
  executor.submit(SfcProviderServiceForwarderAPI.getDeleteAll(new Object[]{},new Class[]{}));
  executor.submit(SfcProviderServiceTypeAPI.getDeleteAll(new Object[]{},new Class[]{}));
  executor.submit(SfcProviderServiceChainAPI.getDeleteAll(new Object[]{},new Class[]{}));
  executor.submit(SfcProviderServicePathAPI.getDeleteAll(new Object[]{},new Class[]{}));
  Thread.sleep(1000);
  final String[] sfNames={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  final IpAddress[] ipMgmtAddress=new IpAddress[sfNames.length];
  final IpAddress[] locatorIpAddress=new IpAddress[sfNames.length];
  SfDataPlaneLocator[] sfDataPlaneLocator=new SfDataPlaneLocator[sfNames.length];
  ServiceFunctionKey[] key=new ServiceFunctionKey[sfNames.length];
  for (int i=0; i < sfNames.length; i++) {
    ipMgmtAddress[i]=new IpAddress(new Ipv4Address(IP_MGMT_ADDRESS[0]));
    locatorIpAddress[i]=new IpAddress(new Ipv4Address(LOCATOR_IP_ADDRESS[0]));
    PortNumber portNumber=new PortNumber(PORT[i]);
    key[i]=new ServiceFunctionKey(sfNames[i]);
    IpBuilder ipBuilder=new IpBuilder();
    ipBuilder.setIp(locatorIpAddress[i]).setPort(portNumber);
    SfDataPlaneLocatorBuilder locatorBuilder=new SfDataPlaneLocatorBuilder();
    locatorBuilder.setName(LOCATOR_IP_ADDRESS[i]).setLocatorType(ipBuilder.build()).setServiceFunctionForwarder(SFF_NAMES[i]);
    sfDataPlaneLocator[i]=locatorBuilder.build();
    ServiceFunctionBuilder sfBuilder=new ServiceFunctionBuilder();
    List<SfDataPlaneLocator> dataPlaneLocatorList=new ArrayList<>();
    dataPlaneLocatorList.add(sfDataPlaneLocator[i]);
    sfBuilder.setName(sfNames[i]).setKey(key[i]).setType(sfTypes[i]).setIpMgmtAddress(ipMgmtAddress[i]).setSfDataPlaneLocator(dataPlaneLocatorList);
    sfList.add(sfBuilder.build());
  }
  ServiceFunctionsBuilder sfsBuilder=new ServiceFunctionsBuilder();
  sfsBuilder.setServiceFunction(sfList);
  executor.submit(SfcProviderServiceFunctionAPI.getPutAll(new Object[]{sfsBuilder.build()},new Class[]{ServiceFunctions.class})).get();
  Thread.sleep(1000);
  for (  ServiceFunction serviceFunction : sfList) {
    boolean ret=SfcProviderServiceTypeAPI.createServiceFunctionTypeEntryExecutor(serviceFunction);
    LOG.debug("String_Node_Str",serviceFunction.getName());
    assertTrue("String_Node_Str",ret);
  }
  for (int i=0; i < SFF_NAMES.length; i++) {
    List<ConnectedSffDictionary> sffDictionaryList=new ArrayList<>();
    for (int j=0; j < 2; j++) {
      ConnectedSffDictionaryBuilder sffDictionaryEntryBuilder=new ConnectedSffDictionaryBuilder();
      ConnectedSffDictionary sffDictEntry=sffDictionaryEntryBuilder.setName(TO_SFF_NAMES[i][j]).build();
      sffDictionaryList.add(sffDictEntry);
    }
    List<ServiceFunctionDictionary> sfDictionaryList=new ArrayList<>();
    ServiceFunction serviceFunction=sfList.get(i);
    SfDataPlaneLocator sfDPLocator=serviceFunction.getSfDataPlaneLocator().get(0);
    SffSfDataPlaneLocatorBuilder sffSfDataPlaneLocatorBuilder=new SffSfDataPlaneLocatorBuilder(sfDPLocator);
    SffSfDataPlaneLocator sffSfDataPlaneLocator=sffSfDataPlaneLocatorBuilder.build();
    ServiceFunctionDictionaryBuilder dictionaryEntryBuilder=new ServiceFunctionDictionaryBuilder();
    dictionaryEntryBuilder.setName(serviceFunction.getName()).setKey(new ServiceFunctionDictionaryKey(serviceFunction.getName())).setType(serviceFunction.getType()).setSffSfDataPlaneLocator(sffSfDataPlaneLocator).setFailmode(Open.class).setSffInterfaces(null);
    ServiceFunctionDictionary sfDictEntry=dictionaryEntryBuilder.build();
    sfDictionaryList.add(sfDictEntry);
    List<SffDataPlaneLocator> locatorList=new ArrayList<>();
    IpBuilder ipBuilder=new IpBuilder();
    ipBuilder.setIp(new IpAddress(new Ipv4Address(SFF_LOCATOR_IP[i]))).setPort(new PortNumber(PORT[i]));
    DataPlaneLocatorBuilder sffLocatorBuilder=new DataPlaneLocatorBuilder();
    sffLocatorBuilder.setLocatorType(ipBuilder.build()).setTransport(VxlanGpe.class);
    SffDataPlaneLocatorBuilder locatorBuilder=new SffDataPlaneLocatorBuilder();
    locatorBuilder.setName(SFF_LOCATOR_IP[i]).setKey(new SffDataPlaneLocatorKey(SFF_LOCATOR_IP[i])).setDataPlaneLocator(sffLocatorBuilder.build());
    locatorList.add(locatorBuilder.build());
    ServiceFunctionForwarderBuilder sffBuilder=new ServiceFunctionForwarderBuilder();
    sffBuilder.setName(SFF_NAMES[i]).setKey(new ServiceFunctionForwarderKey(SFF_NAMES[i])).setSffDataPlaneLocator(locatorList).setServiceFunctionDictionary(sfDictionaryList).setConnectedSffDictionary(sffDictionaryList).setServiceNode(null);
    ServiceFunctionForwarder sff=sffBuilder.build();
    executor.submit(SfcProviderServiceForwarderAPI.getPut(new Object[]{sff},new Class[]{ServiceFunctionForwarder.class})).get();
  }
  Thread.sleep(1000);
}