Program: 59325
Project: 59325
Buggy source:
public String createContainer(String name,Map<String,Object> containerConfiguration){
  this.pingDockerServer();
  String image=getImageName(containerConfiguration);
  CreateContainerCmd createContainerCmd=this.dockerClient.createContainerCmd(image);
  createContainerCmd.withName(name);
  Set<ExposedPort> allExposedPorts=resolveExposedPorts(containerConfiguration,createContainerCmd);
  if (!allExposedPorts.isEmpty()) {
    int numberOfExposedPorts=allExposedPorts.size();
    createContainerCmd.withExposedPorts(allExposedPorts.toArray(new ExposedPort[numberOfExposedPorts]));
  }
  if (containerConfiguration.containsKey(WORKING_DIR)) {
    createContainerCmd.withWorkingDir(asString(containerConfiguration,WORKING_DIR));
  }
  if (containerConfiguration.containsKey(DISABLE_NETWORK)) {
    createContainerCmd.withDisableNetwork(asBoolean(containerConfiguration,DISABLE_NETWORK));
  }
  if (containerConfiguration.containsKey(HOST_NAME)) {
    createContainerCmd.withHostName(asString(containerConfiguration,HOST_NAME));
  }
  if (containerConfiguration.containsKey(PORT_SPECS)) {
    List<String> portSpecs=asListOfString(containerConfiguration,PORT_SPECS);
    createContainerCmd.withPortSpecs(portSpecs.toArray(new String[portSpecs.size()]));
  }
  if (containerConfiguration.containsKey(USER)) {
    createContainerCmd.withUser(asString(containerConfiguration,USER));
  }
  if (containerConfiguration.containsKey(TTY)) {
    createContainerCmd.withTty(asBoolean(containerConfiguration,TTY));
  }
  if (containerConfiguration.containsKey(STDIN_OPEN)) {
    createContainerCmd.withStdinOpen(asBoolean(containerConfiguration,STDIN_OPEN));
  }
  if (containerConfiguration.containsKey(STDIN_ONCE)) {
    createContainerCmd.withStdInOnce(asBoolean(containerConfiguration,STDIN_ONCE));
  }
  if (containerConfiguration.containsKey(MEMORY_LIMIT)) {
    createContainerCmd.withMemoryLimit(asInt(containerConfiguration,MEMORY_LIMIT));
  }
  if (containerConfiguration.containsKey(MEMORY_SWAP)) {
    createContainerCmd.withMemorySwap(asInt(containerConfiguration,MEMORY_SWAP));
  }
  if (containerConfiguration.containsKey(CPU_SHARES)) {
    createContainerCmd.withCpuShares(asInt(containerConfiguration,CPU_SHARES));
  }
  if (containerConfiguration.containsKey(ATTACH_STDIN)) {
    createContainerCmd.withAttachStdin(asBoolean(containerConfiguration,ATTACH_STDIN));
  }
  if (containerConfiguration.containsKey(ATTACH_STDERR)) {
    createContainerCmd.withAttachStderr(asBoolean(containerConfiguration,ATTACH_STDERR));
  }
  if (containerConfiguration.containsKey(ENV)) {
    List<String> env=asListOfString(containerConfiguration,ENV);
    createContainerCmd.withEnv(env.toArray(new String[env.size()]));
  }
  if (containerConfiguration.containsKey(CMD)) {
    List<String> cmd=asListOfString(containerConfiguration,CMD);
    createContainerCmd.withCmd(cmd.toArray(new String[cmd.size()]));
  }
  if (containerConfiguration.containsKey(DNS)) {
    List<String> dns=asListOfString(containerConfiguration,DNS);
    createContainerCmd.withDns(dns.toArray(new String[dns.size()]));
  }
  if (containerConfiguration.containsKey(VOLUMES)) {
    List<String> volumes=asListOfString(containerConfiguration,VOLUMES);
    createContainerCmd.withVolumes(toVolumes(volumes));
  }
  if (containerConfiguration.containsKey(VOLUMES_FROM)) {
    List<String> volumesFrom=asListOfString(containerConfiguration,VOLUMES_FROM);
    createContainerCmd.withVolumesFrom(volumesFrom.toArray(new String[volumesFrom.size()]));
  }
  try {
    return createContainerCmd.exec().getId();
  }
 catch (  NotFoundException e) {
    log.warning(String.format("String_Node_Str",image));
    this.pullImage(image);
    return createContainerCmd.exec().getId();
  }
}

Fixed version (ground truth):
public String createContainer(String name,Map<String,Object> containerConfiguration){
  this.pingDockerServer();
  String image=getImageName(containerConfiguration);
  CreateContainerCmd createContainerCmd=this.dockerClient.createContainerCmd(image);
  createContainerCmd.withName(name);
  Set<ExposedPort> allExposedPorts=resolveExposedPorts(containerConfiguration,createContainerCmd);
  if (!allExposedPorts.isEmpty()) {
    int numberOfExposedPorts=allExposedPorts.size();
    createContainerCmd.withExposedPorts(allExposedPorts.toArray(new ExposedPort[numberOfExposedPorts]));
  }
  if (containerConfiguration.containsKey(WORKING_DIR)) {
    createContainerCmd.withWorkingDir(asString(containerConfiguration,WORKING_DIR));
  }
  if (containerConfiguration.containsKey(DISABLE_NETWORK)) {
    createContainerCmd.withDisableNetwork(asBoolean(containerConfiguration,DISABLE_NETWORK));
  }
  if (containerConfiguration.containsKey(HOST_NAME)) {
    createContainerCmd.withHostName(asString(containerConfiguration,HOST_NAME));
  }
  if (containerConfiguration.containsKey(PORT_SPECS)) {
    List<String> portSpecs=asListOfString(containerConfiguration,PORT_SPECS);
    createContainerCmd.withPortSpecs(portSpecs.toArray(new String[portSpecs.size()]));
  }
  if (containerConfiguration.containsKey(USER)) {
    createContainerCmd.withUser(asString(containerConfiguration,USER));
  }
  if (containerConfiguration.containsKey(TTY)) {
    createContainerCmd.withTty(asBoolean(containerConfiguration,TTY));
  }
  if (containerConfiguration.containsKey(STDIN_OPEN)) {
    createContainerCmd.withStdinOpen(asBoolean(containerConfiguration,STDIN_OPEN));
  }
  if (containerConfiguration.containsKey(STDIN_ONCE)) {
    createContainerCmd.withStdInOnce(asBoolean(containerConfiguration,STDIN_ONCE));
  }
  if (containerConfiguration.containsKey(MEMORY_LIMIT)) {
    createContainerCmd.withMemoryLimit(asInt(containerConfiguration,MEMORY_LIMIT));
  }
  if (containerConfiguration.containsKey(MEMORY_SWAP)) {
    createContainerCmd.withMemorySwap(asInt(containerConfiguration,MEMORY_SWAP));
  }
  if (containerConfiguration.containsKey(CPU_SHARES)) {
    createContainerCmd.withCpuShares(asInt(containerConfiguration,CPU_SHARES));
  }
  if (containerConfiguration.containsKey(ATTACH_STDIN)) {
    createContainerCmd.withAttachStdin(asBoolean(containerConfiguration,ATTACH_STDIN));
  }
  if (containerConfiguration.containsKey(ATTACH_STDERR)) {
    createContainerCmd.withAttachStderr(asBoolean(containerConfiguration,ATTACH_STDERR));
  }
  if (containerConfiguration.containsKey(ENV)) {
    List<String> env=asListOfString(containerConfiguration,ENV);
    createContainerCmd.withEnv(env.toArray(new String[env.size()]));
  }
  if (containerConfiguration.containsKey(CMD)) {
    List<String> cmd=asListOfString(containerConfiguration,CMD);
    createContainerCmd.withCmd(cmd.toArray(new String[cmd.size()]));
  }
  if (containerConfiguration.containsKey(DNS)) {
    List<String> dns=asListOfString(containerConfiguration,DNS);
    createContainerCmd.withDns(dns.toArray(new String[dns.size()]));
  }
  if (containerConfiguration.containsKey(VOLUMES)) {
    List<String> volumes=asListOfString(containerConfiguration,VOLUMES);
    createContainerCmd.withVolumes(toVolumes(volumes));
  }
  if (containerConfiguration.containsKey(VOLUMES_FROM)) {
    List<String> volumesFrom=asListOfString(containerConfiguration,VOLUMES_FROM);
    createContainerCmd.withVolumesFrom(toVolumesFrom(volumesFrom));
  }
  try {
    return createContainerCmd.exec().getId();
  }
 catch (  NotFoundException e) {
    log.warning(String.format("String_Node_Str",image));
    this.pullImage(image);
    return createContainerCmd.exec().getId();
  }
}