Program: 63967
Project: 63967
Buggy source:
@Override public ContainerOrchestratorClient bootstrap(Long stackId) throws CloudbreakException {
  try {
    Stack stack=stackRepository.findOneWithLists(stackId);
    InstanceGroup gateway=stack.getGatewayInstanceGroup();
    InstanceMetaData gatewayInstance=gateway.getInstanceMetaData().iterator().next();
    String consulServers=getConsulServers(gateway,stack.getCoreInstanceGroups(),stack.getConsulServers());
    String dockerAddresses=getDockerAddressInventory(stack.getInstanceGroups());
    DockerClient dockerApiClient=DockerClientBuilder.getInstance(getDockerClientConfig(gatewayInstance.getPublicIp())).build();
    dockerInfoPollingService.pollWithTimeout(dockerCheckerTask,new DockerContext(stack,dockerApiClient,new ArrayList<String>()),POLLING_INTERVAL,MAX_POLLING_ATTEMPTS);
    dockerInfoPollingService.pollWithTimeout(dockerImageCheckerTask,new DockerContext(stack,dockerApiClient,ImmutableList.<String>builder().add(ambariDockerImageName).add(munchausenDockerImageName).add(registratorDockerImageName).add(consulWatchPlugnDockerImageName).add(postgresDockerImageName).build()),POLLING_INTERVAL,MAX_POLLING_ATTEMPTS);
    String[] cmd={"String_Node_Str","String_Node_Str","String_Node_Str",consulServers,dockerAddresses};
    new MunchausenBootstrap(dockerApiClient,munchausenDockerImageName,cmd).call();
    DockerClient swarmManagerClient=DockerClientBuilder.getInstance(getSwarmClientConfig(gatewayInstance.getPublicIp())).build();
    swarmInfoPollingService.pollWithTimeout(swarmCheckerTask,new SwarmContext(stack,swarmManagerClient,stack.getFullNodeCount()),POLLING_INTERVAL,MAX_POLLING_ATTEMPTS);
    return new SwarmContainerOrchestratorClient(swarmManagerClient);
  }
 catch (  Exception e) {
    throw new CloudbreakException(e);
  }
}

Fixed version (ground truth):
@Override public ContainerOrchestratorClient bootstrap(Long stackId) throws CloudbreakException {
  try {
    Stack stack=stackRepository.findOneWithLists(stackId);
    InstanceGroup gateway=stack.getGatewayInstanceGroup();
    LOGGER.info(stackId + "String_Node_Str" + gateway.getId());
    InstanceMetaData gatewayInstance=gateway.getInstanceMetaData().iterator().next();
    LOGGER.info(stackId + "String_Node_Str" + gatewayInstance.getPublicIp());
    String consulServers=getConsulServers(gateway,stack.getCoreInstanceGroups(),stack.getConsulServers());
    String dockerAddresses=getDockerAddressInventory(stack.getInstanceGroups());
    DockerClient dockerApiClient=DockerClientBuilder.getInstance(getDockerClientConfig(gatewayInstance.getPublicIp())).withDockerCmdExecFactory(new DockerCmdExecFactoryImpl()).build();
    dockerInfoPollingService.pollWithTimeout(dockerCheckerTask,new DockerContext(stack,dockerApiClient,new ArrayList<String>()),POLLING_INTERVAL,MAX_POLLING_ATTEMPTS);
    dockerInfoPollingService.pollWithTimeout(dockerImageCheckerTask,new DockerContext(stack,dockerApiClient,ImmutableList.<String>builder().add(ambariDockerImageName).add(munchausenDockerImageName).add(registratorDockerImageName).add(consulWatchPlugnDockerImageName).add(postgresDockerImageName).build()),POLLING_INTERVAL,MAX_POLLING_ATTEMPTS);
    String[] cmd={"String_Node_Str","String_Node_Str","String_Node_Str",consulServers,dockerAddresses};
    new MunchausenBootstrap(dockerApiClient,munchausenDockerImageName,cmd).call();
    DockerClient swarmManagerClient=DockerClientBuilder.getInstance(getSwarmClientConfig(gatewayInstance.getPublicIp())).withDockerCmdExecFactory(new DockerCmdExecFactoryImpl()).build();
    swarmInfoPollingService.pollWithTimeout(swarmCheckerTask,new SwarmContext(stack,swarmManagerClient,stack.getFullNodeCount()),POLLING_INTERVAL,MAX_POLLING_ATTEMPTS);
    return new SwarmContainerOrchestratorClient(swarmManagerClient);
  }
 catch (  Exception e) {
    throw new CloudbreakException(e);
  }
}