Program: 172909
Project: 172909
Buggy source:
/** 
 * Create the resource plan
 * @param config config
 * @return
 */
private static ResourcePlan createResourcePlan(Config config){
  String indexEnv=System.getenv("String_Node_Str");
  String idEnv=System.getenv("String_Node_Str");
  int index=Integer.valueOf(indexEnv);
  initLogger(config,index);
  LOG.log(Level.INFO,String.format("String_Node_Str",idEnv,index));
  ResourcePlan resourcePlan=new ResourcePlan("String_Node_Str",index);
  Map<String,Integer> ports=getPorts(config);
  JobMasterClient client=null;
  String jobMasterIP=JobMasterContext.jobMasterIP(config);
  int masterPort=JobMasterContext.jobMasterPort(config);
  TCPChannel channel;
  try {
    Integer workerPort=ports.get("String_Node_Str");
    channel=initNetworkServer(config,new WorkerNetworkInfo(InetAddress.getByName("String_Node_Str"),workerPort,index),index);
    client=createMasterClient(config,index,InetAddress.getLocalHost().getHostName(),workerPort,masterPort,jobMasterIP);
  }
 catch (  UnknownHostException e) {
    throw new RuntimeException("String_Node_Str" + jobMasterIP,e);
  }
  WorkerController workerController=client.getWorkerController();
  workerController.waitForAllWorkersToJoin(30000);
  List<WorkerNetworkInfo> wInfo=workerController.getWorkerList();
  List<NetworkInfo> nInfos=new ArrayList<>();
  for (  WorkerNetworkInfo w : wInfo) {
    ResourceContainer container=new ResourceContainer(w.getWorkerID());
    resourcePlan.addContainer(container);
    NetworkInfo networkInfo=new NetworkInfo(w.getWorkerID());
    networkInfo.addProperty(TCPContext.NETWORK_PORT,w.getWorkerPort());
    networkInfo.addProperty(TCPContext.NETWORK_HOSTNAME,w.getWorkerIP());
    nInfos.add(networkInfo);
  }
  channel.startConnections(nInfos,null);
  return resourcePlan;
}

Fixed version (ground truth):
/** 
 * Create the resource plan
 * @param config config
 * @return
 */
private static ResourcePlan createResourcePlan(Config config){
  String indexEnv=System.getenv("String_Node_Str");
  String idEnv=System.getenv("String_Node_Str");
  int index=Integer.valueOf(indexEnv);
  initLogger(config,index);
  LOG.log(Level.INFO,String.format("String_Node_Str",idEnv,index));
  ResourcePlan resourcePlan=new ResourcePlan("String_Node_Str",index);
  Map<String,Integer> ports=getPorts(config);
  JobMasterClient client=null;
  String jobMasterIP=JobMasterContext.jobMasterIP(config);
  int masterPort=JobMasterContext.jobMasterPort(config);
  TCPChannel channel;
  try {
    Integer workerPort=ports.get("String_Node_Str");
    channel=initNetworkServer(config,new WorkerNetworkInfo(InetAddress.getByName("String_Node_Str"),workerPort,index),index);
    String localIp=getIPAddress();
    client=createMasterClient(config,index,localIp,workerPort,masterPort,jobMasterIP);
  }
 catch (  UnknownHostException e) {
    throw new RuntimeException("String_Node_Str" + jobMasterIP,e);
  }
  WorkerController workerController=client.getWorkerController();
  workerController.waitForAllWorkersToJoin(30000);
  List<WorkerNetworkInfo> wInfo=workerController.getWorkerList();
  List<NetworkInfo> nInfos=new ArrayList<>();
  for (  WorkerNetworkInfo w : wInfo) {
    ResourceContainer container=new ResourceContainer(w.getWorkerID());
    resourcePlan.addContainer(container);
    NetworkInfo networkInfo=new NetworkInfo(w.getWorkerID());
    networkInfo.addProperty(TCPContext.NETWORK_PORT,w.getWorkerPort());
    networkInfo.addProperty(TCPContext.NETWORK_HOSTNAME,w.getWorkerIP().toString());
    nInfos.add(networkInfo);
  }
  channel.startConnections(nInfos,null);
  return resourcePlan;
}