Program: 132159
Project: 132159
Buggy source:
@Test public void testReadRenderedServicePathFirstHop() throws ExecutionException, InterruptedException {
  boolean ret;
  String sfcName="String_Node_Str";
  String[] sfNames={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  ServiceFunctionChainKey key=new ServiceFunctionChainKey(sfcName);
  List<SfcServiceFunction> sfcServiceFunctionList=new ArrayList<>();
  for (int i=0; i < sfNames.length; i++) {
    SfcServiceFunctionBuilder sfcSfBuilder=new SfcServiceFunctionBuilder();
    SfcServiceFunction sfcServiceFunction=sfcSfBuilder.setName(sfNames[i]).setKey(new SfcServiceFunctionKey(sfNames[i])).setType(sfTypes[i]).build();
    sfcServiceFunctionList.add(sfcServiceFunction);
  }
  ServiceFunctionChainBuilder sfcBuilder=new ServiceFunctionChainBuilder();
  sfcBuilder.setName(sfcName).setKey(key).setSfcServiceFunction(sfcServiceFunctionList).setSymmetric(true);
  Object[] parameters={sfcBuilder.build()};
  Class[] parameterTypes={ServiceFunctionChain.class};
  executor.submit(SfcProviderServiceChainAPI.getPut(parameters,parameterTypes)).get();
  Object[] parameters2={sfcName};
  Class[] parameterTypes2={String.class};
  Object result=executor.submit(SfcProviderServiceChainAPI.getRead(parameters2,parameterTypes2)).get();
  ServiceFunctionChain sfc2=(ServiceFunctionChain)result;
  assertNotNull("String_Node_Str",sfc2);
  assertEquals("String_Node_Str",sfc2.getSfcServiceFunction(),sfcServiceFunctionList);
  String pathName="String_Node_Str";
  ServiceFunctionPathBuilder pathBuilder=new ServiceFunctionPathBuilder();
  pathBuilder.setName(pathName).setServiceChainName(sfcName).setSymmetric(true);
  ServiceFunctionPath serviceFunctionPath=pathBuilder.build();
  assertNotNull("String_Node_Str",serviceFunctionPath);
  ret=SfcProviderServicePathAPI.putServiceFunctionPathExecutor(serviceFunctionPath);
  assertTrue("String_Node_Str",ret);
  RenderedServicePath renderedServicePath=null;
  RenderedServicePath revRenderedServicePath=null;
  CreateRenderedPathInputBuilder createRenderedPathInputBuilder=new CreateRenderedPathInputBuilder();
  createRenderedPathInputBuilder.setSymmetric(serviceFunctionPath.isSymmetric());
  renderedServicePath=SfcProviderRenderedPathAPI.createRenderedServicePathAndState(serviceFunctionPath,createRenderedPathInputBuilder.build());
  assertNotNull("String_Node_Str",renderedServicePath);
  revRenderedServicePath=SfcProviderRenderedPathAPI.createSymmetricRenderedServicePathAndState(renderedServicePath);
  assertNotNull("String_Node_Str",revRenderedServicePath);
  RenderedServicePathFirstHop firstHop;
  RenderedServicePathFirstHop lastHop;
  firstHop=SfcProviderRenderedPathAPI.readRenderedServicePathFirstHop(renderedServicePath.getName());
  assertNotNull("String_Node_Str",firstHop);
  lastHop=SfcProviderRenderedPathAPI.readRenderedServicePathFirstHop(revRenderedServicePath.getName());
  assertNotNull("String_Node_Str",lastHop);
  LOG.debug("String_Node_Str",firstHop.getIp().toString(),firstHop.getPort());
  LOG.debug("String_Node_Str",lastHop.getIp().toString(),lastHop.getPort());
  assertEquals("String_Node_Str",firstHop.getIp(),new IpAddress(new Ipv4Address(SFF_LOCATOR_IP[0])));
  assertEquals("String_Node_Str",firstHop.getPort(),new PortNumber(PORT[0]));
  assertEquals("String_Node_Str",lastHop.getIp(),new IpAddress(new Ipv4Address(SFF_LOCATOR_IP[SFF_LOCATOR_IP.length - 1])));
  assertEquals("String_Node_Str",lastHop.getPort(),new PortNumber(PORT[PORT.length - 1]));
  SfcProviderRenderedPathAPI.deleteRenderedServicePathExecutor(renderedServicePath.getName());
  SfcProviderRenderedPathAPI.deleteRenderedServicePathExecutor(revRenderedServicePath.getName());
}

Fixed version (ground truth):
@Test public void testReadRenderedServicePathFirstHop() throws ExecutionException, InterruptedException {
  boolean ret;
  String sfcName="String_Node_Str";
  String[] sfNames={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  ServiceFunctionChainKey key=new ServiceFunctionChainKey(sfcName);
  List<SfcServiceFunction> sfcServiceFunctionList=new ArrayList<>();
  for (int i=0; i < sfNames.length; i++) {
    SfcServiceFunctionBuilder sfcSfBuilder=new SfcServiceFunctionBuilder();
    SfcServiceFunction sfcServiceFunction=sfcSfBuilder.setName(sfNames[i]).setKey(new SfcServiceFunctionKey(sfNames[i])).setType(sfTypes[i]).build();
    sfcServiceFunctionList.add(sfcServiceFunction);
  }
  ServiceFunctionChainBuilder sfcBuilder=new ServiceFunctionChainBuilder();
  sfcBuilder.setName(sfcName).setKey(key).setSfcServiceFunction(sfcServiceFunctionList).setSymmetric(true);
  Object[] parameters={sfcBuilder.build()};
  Class[] parameterTypes={ServiceFunctionChain.class};
  executor.submit(SfcProviderServiceChainAPI.getPut(parameters,parameterTypes)).get();
  Object[] parameters2={sfcName};
  Class[] parameterTypes2={String.class};
  Object result=executor.submit(SfcProviderServiceChainAPI.getRead(parameters2,parameterTypes2)).get();
  ServiceFunctionChain sfc2=(ServiceFunctionChain)result;
  assertNotNull("String_Node_Str",sfc2);
  assertEquals("String_Node_Str",sfc2.getSfcServiceFunction(),sfcServiceFunctionList);
  String pathName="String_Node_Str";
  ServiceFunctionPathBuilder pathBuilder=new ServiceFunctionPathBuilder();
  pathBuilder.setName(pathName).setServiceChainName(sfcName).setSymmetric(true);
  ServiceFunctionPath serviceFunctionPath=pathBuilder.build();
  assertNotNull("String_Node_Str",serviceFunctionPath);
  ret=SfcProviderServicePathAPI.putServiceFunctionPathExecutor(serviceFunctionPath);
  assertTrue("String_Node_Str",ret);
  RenderedServicePath renderedServicePath=null;
  RenderedServicePath revRenderedServicePath=null;
  CreateRenderedPathInputBuilder createRenderedPathInputBuilder=new CreateRenderedPathInputBuilder();
  createRenderedPathInputBuilder.setSymmetric(serviceFunctionPath.isSymmetric());
  try {
    renderedServicePath=SfcProviderRenderedPathAPI.createRenderedServicePathAndState(serviceFunctionPath,createRenderedPathInputBuilder.build());
  }
 catch (  NullPointerException e) {
    e.printStackTrace();
  }
  assertNotNull("String_Node_Str",renderedServicePath);
  try {
    revRenderedServicePath=SfcProviderRenderedPathAPI.createSymmetricRenderedServicePathAndState(renderedServicePath);
  }
 catch (  NullPointerException e) {
    e.printStackTrace();
  }
  assertNotNull("String_Node_Str",revRenderedServicePath);
  RenderedServicePathFirstHop firstHop;
  RenderedServicePathFirstHop lastHop;
  firstHop=SfcProviderRenderedPathAPI.readRenderedServicePathFirstHop(renderedServicePath.getName());
  assertNotNull("String_Node_Str",firstHop);
  lastHop=SfcProviderRenderedPathAPI.readRenderedServicePathFirstHop(revRenderedServicePath.getName());
  assertNotNull("String_Node_Str",lastHop);
  LOG.debug("String_Node_Str",firstHop.getIp().toString(),firstHop.getPort());
  LOG.debug("String_Node_Str",lastHop.getIp().toString(),lastHop.getPort());
  assertEquals("String_Node_Str",firstHop.getIp(),new IpAddress(new Ipv4Address(SFF_LOCATOR_IP[0])));
  assertEquals("String_Node_Str",firstHop.getPort(),new PortNumber(PORT[0]));
  assertEquals("String_Node_Str",lastHop.getIp(),new IpAddress(new Ipv4Address(SFF_LOCATOR_IP[SFF_LOCATOR_IP.length - 1])));
  assertEquals("String_Node_Str",lastHop.getPort(),new PortNumber(PORT[PORT.length - 1]));
  SfcProviderRenderedPathAPI.deleteRenderedServicePathExecutor(renderedServicePath.getName());
  SfcProviderRenderedPathAPI.deleteRenderedServicePathExecutor(revRenderedServicePath.getName());
}