nus-yam/ex-repair huggingface dataset:
Program: 59335
Project: 59335
Buggy source:
public void startCubeMappedContainer(@Observes BeforeStart event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry,CubeConfiguration cubeConfiguration){
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  if (cubeConfiguration.shouldAllowToConnectToRunningContainers() && isCubeRunning(cube)) {
    controlEvent.fire(new PreRunningCube(cube));
    return;
  }
  controlEvent.fire(new CreateCube(cube));
  controlEvent.fire(new StartCube(cube));
}

Fixed version (ground truth):
public void startCubeMappedContainer(@Observes BeforeStart event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry,CubeConfiguration cubeConfiguration){
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  ConnectionMode connectionMode=cubeConfiguration.getConnectionMode();
  if (connectionMode.isAllowReconnect() && isCubeRunning(cube)) {
    controlEvent.fire(new PreRunningCube(cube));
    return;
  }
  controlEvent.fire(new CreateCube(cube));
  controlEvent.fire(new StartCube(cube));
  if (connectionMode.isAllowReconnect() && !connectionMode.isStoppable()) {
    controlEvent.fire(new PreRunningCube(cube));
  }
}
Program: 59336
Project: 59336
Buggy source:
@Test public void shouldUsePreRunningContainers(){
  Map<String,String> data=new HashMap<String,String>();
  data.put("String_Node_Str","String_Node_Str");
  data.put("String_Node_Str","String_Node_Str");
  data.put("String_Node_Str","String_Node_Str");
  CubeConfiguration configuration=CubeConfiguration.fromMap(data);
  bind(ApplicationScoped.class,CubeConfiguration.class,configuration);
  Container container=mock(Container.class);
  when(container.getNames()).thenReturn(new String[]{"String_Node_Str"});
  when(executor.listRunningContainers()).thenReturn(Arrays.asList(container));
  bind(ApplicationScoped.class,DockerClientExecutor.class,executor);
  fire(new BeforeSuite());
  assertEventFired(CreateCube.class,1);
  assertEventFired(StartCube.class,1);
  assertEventFired(PreRunningCube.class,1);
  assertEventFiredOnOtherThread(CreateCube.class);
  assertEventFiredOnOtherThread(StartCube.class);
  assertEventFiredOnOtherThread(PreRunningCube.class);
}

Fixed version (ground truth):
@Test public void shouldUsePreRunningContainers(){
  Map<String,String> data=new HashMap<String,String>();
  data.put("String_Node_Str","String_Node_Str");
  data.put("String_Node_Str",ConnectionMode.STARTORCONNECT.name());
  data.put("String_Node_Str","String_Node_Str");
  CubeConfiguration configuration=CubeConfiguration.fromMap(data);
  bind(ApplicationScoped.class,CubeConfiguration.class,configuration);
  Container container=mock(Container.class);
  when(container.getNames()).thenReturn(new String[]{"String_Node_Str"});
  when(executor.listRunningContainers()).thenReturn(Arrays.asList(container));
  bind(ApplicationScoped.class,DockerClientExecutor.class,executor);
  fire(new BeforeSuite());
  assertEventFired(CreateCube.class,1);
  assertEventFired(StartCube.class,1);
  assertEventFired(PreRunningCube.class,1);
  assertEventFiredOnOtherThread(CreateCube.class);
  assertEventFiredOnOtherThread(StartCube.class);
  assertEventFiredOnOtherThread(PreRunningCube.class);
}
Program: 59337
Project: 59337
Buggy source:
private Set<ExposedPort> resolveExposedPorts(Map<String,Object> containerConfiguration,CreateContainerCmd createContainerCmd){
  Set<ExposedPort> allExposedPorts=new HashSet<>();
  if (containerConfiguration.containsKey(PORT_BINDINGS)) {
    List<String> portBindings=asListOfString(containerConfiguration,PORT_BINDINGS);
    Ports assignPorts=assignPorts(portBindings);
    Map<ExposedPort,Binding> bindings=assignPorts.getBindings();
    Set<ExposedPort> exposedPorts=bindings.keySet();
    allExposedPorts.addAll(exposedPorts);
  }
  if (containerConfiguration.containsKey(EXPOSED_PORTS)) {
    Set<ExposedPort> exposedPorts=toExposedPorts(asListOfString(containerConfiguration,EXPOSED_PORTS));
    allExposedPorts.addAll(exposedPorts);
  }
  return allExposedPorts;
}

Fixed version (ground truth):
private Set<ExposedPort> resolveExposedPorts(Map<String,Object> containerConfiguration,CreateContainerCmd createContainerCmd){
  Set<ExposedPort> allExposedPorts=new HashSet<>();
  if (containerConfiguration.containsKey(PORT_BINDINGS)) {
    List<String> portBindings=asListOfString(containerConfiguration,PORT_BINDINGS);
    Ports assignPorts=assignPorts(portBindings);
    Map<ExposedPort,Binding[]> bindings=assignPorts.getBindings();
    Set<ExposedPort> exposedPorts=bindings.keySet();
    allExposedPorts.addAll(exposedPorts);
  }
  if (containerConfiguration.containsKey(EXPOSED_PORTS)) {
    Set<ExposedPort> exposedPorts=toExposedPorts(asListOfString(containerConfiguration,EXPOSED_PORTS));
    allExposedPorts.addAll(exposedPorts);
  }
  return allExposedPorts;
}
Program: 59339
Project: 59339
Buggy source:
private static final ExposedPort[] toExposedPorts(List<String> exposedPortsList){
  ExposedPort[] exposedPorts=new ExposedPort[exposedPortsList.size()];
  for (int i=0; i < exposedPorts.length; i++) {
    exposedPorts[i]=ExposedPort.parse(exposedPortsList.get(i));
  }
  return exposedPorts;
}

Fixed version (ground truth):
private static final Set<ExposedPort> toExposedPorts(List<String> exposedPortsList){
  Set<ExposedPort> exposedPorts=new HashSet<>();
  for (  String exposedPort : exposedPortsList) {
    exposedPorts.add(ExposedPort.parse(exposedPort));
  }
  return exposedPorts;
}
Program: 59341
Project: 59341
Buggy source:
@SuppressWarnings("String_Node_Str") public static CubeConfiguration fromMap(Map<String,String> map){
  CubeConfiguration cubeConfiguration=new CubeConfiguration();
  if (map.containsKey(DOCKER_VERSION)) {
    cubeConfiguration.dockerServerVersion=map.get(DOCKER_VERSION);
  }
  if (map.containsKey(DOCKER_URI)) {
    cubeConfiguration.dockerServerUri=map.get(DOCKER_URI);
  }
  if (map.containsKey(DOCKER_REGISTRY)) {
    cubeConfiguration.dockerRegistry=map.get(DOCKER_REGISTRY);
  }
  if (map.containsKey(DOCKER_CONTAINERS)) {
    String content=map.get(DOCKER_CONTAINERS);
    cubeConfiguration.dockerContainersContent=ConfigUtil.applyExtendsRules((Map<String,Object>)new Yaml().load(content));
  }
  if (map.containsKey(DOCKER_CONTAINERS_FILE)) {
    String location=map.get(DOCKER_CONTAINERS_FILE);
    try {
      cubeConfiguration.dockerContainersContent=ConfigUtil.applyExtendsRules((Map<String,Object>)new Yaml().load(new FileInputStream(location)));
    }
 catch (    FileNotFoundException e) {
      throw new IllegalArgumentException(e);
    }
  }
  if (map.containsKey(AUTO_START_CONTAINERS)) {
    cubeConfiguration.autoStartContainers=ConfigUtil.trim(map.get(AUTO_START_CONTAINERS).split("String_Node_Str"));
  }
  return cubeConfiguration;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static CubeConfiguration fromMap(Map<String,String> map){
  CubeConfiguration cubeConfiguration=new CubeConfiguration();
  if (map.containsKey(DOCKER_VERSION)) {
    cubeConfiguration.dockerServerVersion=map.get(DOCKER_VERSION);
  }
  if (map.containsKey(DOCKER_URI)) {
    cubeConfiguration.dockerServerUri=map.get(DOCKER_URI);
  }
  if (map.containsKey(DOCKER_REGISTRY)) {
    cubeConfiguration.dockerRegistry=map.get(DOCKER_REGISTRY);
  }
  if (map.containsKey(DOCKER_CONTAINERS)) {
    String content=map.get(DOCKER_CONTAINERS);
    cubeConfiguration.dockerContainersContent=ConfigUtil.applyExtendsRules((Map<String,Object>)new Yaml().load(content));
  }
  if (map.containsKey(DOCKER_CONTAINERS_FILE)) {
    String location=map.get(DOCKER_CONTAINERS_FILE);
    try {
      cubeConfiguration.dockerContainersContent=ConfigUtil.applyExtendsRules((Map<String,Object>)new Yaml().load(new FileInputStream(location)));
    }
 catch (    FileNotFoundException e) {
      throw new IllegalArgumentException(e);
    }
  }
  if (map.containsKey(AUTO_START_CONTAINERS)) {
    cubeConfiguration.autoStartContainers=ConfigUtil.trim(map.get(AUTO_START_CONTAINERS).split("String_Node_Str"));
  }
  if (map.containsKey(SHOULD_ALLOW_TO_CONNECT_TO_RUNNING_CONTAINERS)) {
    cubeConfiguration.shouldAllowToConnectToRunningContainers=Boolean.parseBoolean(map.get(SHOULD_ALLOW_TO_CONNECT_TO_RUNNING_CONTAINERS));
  }
  return cubeConfiguration;
}
Program: 59342
Project: 59342
Buggy source:
public void startAutoContainers(@Observes(precedence=100) BeforeSuite event,CubeConfiguration configuration){
  for (  String cubeId : configuration.getAutoStartContainers()) {
    controlEvent.fire(new CreateCube(cubeId));
    controlEvent.fire(new StartCube(cubeId));
  }
}

Fixed version (ground truth):
public void startAutoContainers(@Observes(precedence=100) BeforeSuite event,CubeConfiguration configuration){
  for (  String cubeId : configuration.getAutoStartContainers()) {
    if (configuration.shouldAllowToConnectToRunningContainers() && isCubeRunning(cubeId)) {
      controlEvent.fire(new PreRunningCube(cubeId));
    }
 else {
      controlEvent.fire(new CreateCube(cubeId));
      controlEvent.fire(new StartCube(cubeId));
    }
  }
}
Program: 59343
Project: 59343
Buggy source:
public void startCubeMappedContainer(@Observes BeforeStart event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry){
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  controlEvent.fire(new CreateCube(cube));
  controlEvent.fire(new StartCube(cube));
}

Fixed version (ground truth):
public void startCubeMappedContainer(@Observes BeforeStart event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry,CubeConfiguration cubeConfiguration){
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  if (cubeConfiguration.shouldAllowToConnectToRunningContainers() && isCubeRunning(cube)) {
    controlEvent.fire(new PreRunningCube(cube));
    return;
  }
  controlEvent.fire(new CreateCube(cube));
  controlEvent.fire(new StartCube(cube));
}
Program: 59344
Project: 59344
Buggy source:
@Override public void stop() throws CubeControlException {
  if (state == State.STOPPED) {
    return;
  }
  try {
    lifecycle.fire(new BeforeStop(id));
    executor.stopContainer(id);
    state=State.STOPPED;
    lifecycle.fire(new AfterStop(id));
  }
 catch (  Exception e) {
    state=State.STOP_FAILED;
    throw CubeControlException.failedStop(id,e);
  }
}

Fixed version (ground truth):
@Override public void stop() throws CubeControlException {
  if (state == State.STOPPED || state == State.PRE_RUNNING) {
    return;
  }
  try {
    lifecycle.fire(new BeforeStop(id));
    executor.stopContainer(id);
    state=State.STOPPED;
    lifecycle.fire(new AfterStop(id));
  }
 catch (  Exception e) {
    state=State.STOP_FAILED;
    throw CubeControlException.failedStop(id,e);
  }
}
Program: 59345
Project: 59345
Buggy source:
@Override public Binding bindings(){
  if (binding != null) {
    return binding;
  }
  if (state != State.STARTED) {
    throw new IllegalStateException("String_Node_Str" + id + "String_Node_Str"+ State.STARTED+ "String_Node_Str"+ state);
  }
  binding=BindingUtil.binding(executor,id);
  return binding;
}

Fixed version (ground truth):
@Override public Binding bindings(){
  if (binding != null) {
    return binding;
  }
  if (state != State.STARTED && state != State.PRE_RUNNING) {
    throw new IllegalStateException("String_Node_Str" + id + "String_Node_Str"+ State.STARTED+ "String_Node_Str"+ State.PRE_RUNNING+ "String_Node_Str"+ state);
  }
  binding=BindingUtil.binding(executor,id);
  return binding;
}
Program: 59346
Project: 59346
Buggy source:
@Override public void start() throws CubeControlException {
  if (state == State.STARTED) {
    return;
  }
  try {
    lifecycle.fire(new BeforeStart(id));
    executor.startContainer(id,configuration);
    state=State.STARTED;
    if (!AwaitStrategyFactory.create(executor,this,configuration).await()) {
      throw new IllegalArgumentException(String.format("String_Node_Str",id));
    }
    lifecycle.fire(new AfterStart(id));
  }
 catch (  Exception e) {
    state=State.START_FAILED;
    throw CubeControlException.failedStart(id,e);
  }
}

Fixed version (ground truth):
@Override public void start() throws CubeControlException {
  if (state == State.STARTED || state == State.PRE_RUNNING) {
    return;
  }
  try {
    lifecycle.fire(new BeforeStart(id));
    executor.startContainer(id,configuration);
    state=State.STARTED;
    if (!AwaitStrategyFactory.create(executor,this,configuration).await()) {
      throw new IllegalArgumentException(String.format("String_Node_Str",id));
    }
    lifecycle.fire(new AfterStart(id));
  }
 catch (  Exception e) {
    state=State.START_FAILED;
    throw CubeControlException.failedStart(id,e);
  }
}
Program: 59347
Project: 59347
Buggy source:
@Before @SuppressWarnings("String_Node_Str") public void setup(){
  when(cube.getId()).thenReturn(CUBE_ID);
  when(container.getName()).thenReturn(CUBE_ID);
  when(container.getDeployableContainer()).thenReturn(deployableContainer);
  when(containerRegistry.getContainers()).thenReturn(Arrays.asList(container));
  registry=new DockerCubeRegistry();
  registry.addCube(cube);
  bind(ApplicationScoped.class,CubeRegistry.class,registry);
  bind(ApplicationScoped.class,ContainerRegistry.class,containerRegistry);
}

Fixed version (ground truth):
@Before @SuppressWarnings("String_Node_Str") public void setup(){
  when(cube.getId()).thenReturn(CUBE_ID);
  when(container.getName()).thenReturn(CUBE_ID);
  when(container.getDeployableContainer()).thenReturn(deployableContainer);
  when(containerRegistry.getContainers()).thenReturn(Arrays.asList(container));
  registry=new DockerCubeRegistry();
  registry.addCube(cube);
  bind(ApplicationScoped.class,CubeRegistry.class,registry);
  bind(ApplicationScoped.class,ContainerRegistry.class,containerRegistry);
  bind(ApplicationScoped.class,CubeConfiguration.class,new CubeConfiguration());
}
Program: 59349
Project: 59349
Buggy source:
private Ports assignPorts(List<String> portBindings){
  Ports ports=new Ports();
  for (  String portBinding : portBindings) {
    String[] elements=portBinding.split(PORTS_SEPARATOR);
    if (elements.length == 1) {
      log.info("String_Node_Str" + elements[0]);
      String exposedPortValue=elements[0].substring(0,elements[0].indexOf("String_Node_Str"));
      ports.bind(ExposedPort.parse(elements[0]),toBinding(exposedPortValue));
    }
 else {
      if (elements.length == 2) {
        ports.bind(ExposedPort.parse(elements[1]),toBinding(elements[0]));
      }
 else {
        if (elements.length == 3) {
          ports.bind(ExposedPort.parse(elements[2]),toBinding(elements[0] + elements[1]));
        }
      }
    }
  }
  return ports;
}

Fixed version (ground truth):
private Ports assignPorts(List<String> portBindings){
  Ports ports=new Ports();
  for (  String portBinding : portBindings) {
    String[] elements=portBinding.split(PORTS_SEPARATOR);
    if (elements.length == 1) {
      log.info("String_Node_Str" + elements[0]);
      String exposedPortValue=elements[0].substring(0,elements[0].indexOf("String_Node_Str"));
      ports.bind(ExposedPort.parse(elements[0]),toBinding(exposedPortValue));
    }
 else {
      if (elements.length == 2) {
        ports.bind(ExposedPort.parse(elements[1]),toBinding(elements[0]));
      }
    }
  }
  return ports;
}
Program: 59350
Project: 59350
Buggy source:
public static Binding binding(Map<String,Object> cubeConfiguration){
  Binding binding=new Binding(NO_GATEWAY);
  if (cubeConfiguration.containsKey("String_Node_Str")) {
    @SuppressWarnings("String_Node_Str") List<Map<String,Object>> cubePortBindings=(List<Map<String,Object>>)cubeConfiguration.get("String_Node_Str");
    for (    Map<String,Object> cubePortBinding : cubePortBindings) {
      if (cubePortBinding.containsKey("String_Node_Str") && cubePortBinding.containsKey("String_Node_Str")) {
        String exposedPortAndProtocol=(String)cubePortBinding.get("String_Node_Str");
        int exposedPort=Integer.parseInt(exposedPortAndProtocol.substring(0,exposedPortAndProtocol.indexOf("String_Node_Str")));
        int port=(int)cubePortBinding.get("String_Node_Str");
        binding.addPortBinding(exposedPort,port);
      }
    }
  }
  return binding;
}

Fixed version (ground truth):
public static Binding binding(Map<String,Object> cubeConfiguration){
  Binding binding=new Binding(NO_GATEWAY);
  if (cubeConfiguration.containsKey("String_Node_Str")) {
    @SuppressWarnings("String_Node_Str") List<String> cubePortBindings=(List<String>)cubeConfiguration.get("String_Node_Str");
    for (    String cubePortBinding : cubePortBindings) {
      String[] elements=cubePortBinding.split(PORTS_SEPARATOR);
      if (elements.length == 1) {
        int exposedPort=Integer.parseInt(elements[0].substring(0,elements[0].indexOf("String_Node_Str")));
        binding.addPortBinding(exposedPort,exposedPort);
      }
 else {
        if (elements.length == 2) {
          int exposedPort=Integer.parseInt(elements[1].substring(0,elements[1].indexOf("String_Node_Str")));
          int port=Integer.parseInt(elements[0]);
          binding.addPortBinding(exposedPort,port);
        }
      }
    }
  }
  return binding;
}
Program: 59351
Project: 59351
Buggy source:
public static final AwaitStrategy create(DockerClientExecutor dockerClientExecutor,Cube cube,Map<String,Object> options){
  if (options.containsKey(AWAIT)) {
    @SuppressWarnings("String_Node_Str") Map<String,Object> awaitOptions=(Map<String,Object>)options.get(AWAIT);
    if (awaitOptions.containsKey(STRATEGY)) {
      String strategy=((String)awaitOptions.get(STRATEGY)).toLowerCase();
switch (strategy) {
case PollingAwaitStrategy.TAG:
        return new PollingAwaitStrategy(cube);
case NativeAwaitStrategy.TAG:
      return new NativeAwaitStrategy(cube,dockerClientExecutor);
case StaticAwaitStrategy.TAG:
    return new StaticAwaitStrategy(cube,awaitOptions);
default :
  return new NativeAwaitStrategy(cube,dockerClientExecutor);
}
}
 else {
log.warning("String_Node_Str");
return new NativeAwaitStrategy(cube,dockerClientExecutor);
}
}
 else {
log.warning("String_Node_Str");
return new NativeAwaitStrategy(cube,dockerClientExecutor);
}
}

Fixed version (ground truth):
public static final AwaitStrategy create(DockerClientExecutor dockerClientExecutor,Cube cube,Map<String,Object> options){
  if (options.containsKey(AWAIT)) {
    @SuppressWarnings("String_Node_Str") Map<String,Object> awaitOptions=(Map<String,Object>)options.get(AWAIT);
    if (awaitOptions.containsKey(STRATEGY)) {
      String strategy=((String)awaitOptions.get(STRATEGY)).toLowerCase();
switch (strategy) {
case PollingAwaitStrategy.TAG:
        return new PollingAwaitStrategy(cube,awaitOptions);
case NativeAwaitStrategy.TAG:
      return new NativeAwaitStrategy(cube,dockerClientExecutor);
case StaticAwaitStrategy.TAG:
    return new StaticAwaitStrategy(cube,awaitOptions);
default :
  return new NativeAwaitStrategy(cube,dockerClientExecutor);
}
}
 else {
log.warning("String_Node_Str");
return new NativeAwaitStrategy(cube,dockerClientExecutor);
}
}
 else {
log.warning("String_Node_Str");
return new NativeAwaitStrategy(cube,dockerClientExecutor);
}
}
Program: 59352
Project: 59352
Buggy source:
@Override public boolean await(){
  Binding bindings=cube.bindings();
  for (  PortBinding ports : bindings.getPortBindings()) {
    log.fine(String.format("String_Node_Str",bindings.getIP(),ports.getBindingPort()));
    if (!Ping.ping(bindings.getIP(),ports.getBindingPort(),DEFAULT_POLL_ITERATIONS,DEFAULT_SLEEP_POLL_TIME,TimeUnit.MILLISECONDS)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean await(){
  Binding bindings=cube.bindings();
  for (  PortBinding ports : bindings.getPortBindings()) {
    log.fine(String.format("String_Node_Str",bindings.getIP(),ports.getBindingPort()));
    if (!Ping.ping(bindings.getIP(),ports.getBindingPort(),this.pollIterations,this.sleepPollTime,TimeUnit.MILLISECONDS)) {
      return false;
    }
  }
  return true;
}
Program: 59353
Project: 59353
Buggy source:
public PollingAwaitStrategy(Cube cube){
  this.cube=cube;
}

Fixed version (ground truth):
public PollingAwaitStrategy(Cube cube,Map<String,Object> params){
  this.cube=cube;
  if (params.containsKey(POLLING_TIME)) {
    this.sleepPollTime=(Integer)params.get(POLLING_TIME);
  }
  if (params.containsKey(ITERATIONS)) {
    this.pollIterations=(Integer)params.get(ITERATIONS);
  }
}
Program: 59354
Project: 59354
Buggy source:
@SuppressWarnings("String_Node_Str") public StaticAwaitStrategy(Cube cube,Map<String,Object> params){
  this.ip=(String)params.get(IP);
  this.ports.addAll((Collection<? extends Integer>)params.get(PORTS));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public StaticAwaitStrategy(Cube cube,Map<String,Object> params){
  this.ip=(String)params.get(IP);
  this.ports.addAll((Collection<? extends Integer>)params.get(PORTS));
  if (params.containsKey(POLLING_TIME)) {
    this.sleepPollTime=(Integer)params.get(POLLING_TIME);
  }
  if (params.containsKey(ITERATIONS)) {
    this.pollIterations=(Integer)params.get(ITERATIONS);
  }
}
Program: 59355
Project: 59355
Buggy source:
@Override public boolean await(){
  for (  Integer port : this.ports) {
    if (!Ping.ping(this.ip,port,DEFAULT_POLL_ITERATIONS,DEFAULT_SLEEP_POLL_TIME,TimeUnit.MILLISECONDS)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean await(){
  for (  Integer port : this.ports) {
    if (!Ping.ping(this.ip,port,this.pollIterations,this.sleepPollTime,TimeUnit.MILLISECONDS)) {
      return false;
    }
  }
  return true;
}
Program: 59356
Project: 59356
Buggy source:
@Override public boolean await(){
  InspectContainerResponse inspectContainer=this.dockerClientExecutor.inspectContainer(this.createContainer);
  HostConfig hostConfig=inspectContainer.getHostConfig();
  Ports portBindings=hostConfig.getPortBindings();
  Map<ExposedPort,Binding> bindings=portBindings.getBindings();
  NetworkSettings networkSettings=inspectContainer.getNetworkSettings();
  for (  Map.Entry<ExposedPort,Binding> binding : bindings.entrySet()) {
    if (!Ping.ping(networkSettings.getGateway(),binding.getValue().getHostPort(),DEFAULT_POLL_ITERATIONS,DEFAULT_SLEEP_POLL_TIME,TimeUnit.MILLISECONDS)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean await(){
  InspectContainerResponse inspectContainer=this.dockerClientExecutor.inspectContainer(this.createContainer);
  HostConfig hostConfig=inspectContainer.getHostConfig();
  Ports portBindings=hostConfig.getPortBindings();
  Map<ExposedPort,Binding> bindings=portBindings.getBindings();
  NetworkSettings networkSettings=inspectContainer.getNetworkSettings();
  for (  Map.Entry<ExposedPort,Binding> binding : bindings.entrySet()) {
    log.fine(String.format("String_Node_Str",networkSettings.getGateway(),binding.getValue().getHostPort()));
    if (!Ping.ping(networkSettings.getGateway(),binding.getValue().getHostPort(),DEFAULT_POLL_ITERATIONS,DEFAULT_SLEEP_POLL_TIME,TimeUnit.MILLISECONDS)) {
      return false;
    }
  }
  return true;
}
Program: 59357
Project: 59357
Buggy source:
public void startDockerImage(@Observes BeforeStart event,CubeConfiguration cubeConfiguration,ContainerMapping containerMapping){
  Map<String,Object> dockerContainersContent=cubeConfiguration.getDockerContainersContent();
  Container container=getContainerByDeployableContainer(event.getDeployableContainer());
  String containerName=container.getName();
  @SuppressWarnings("String_Node_Str") Map<String,Object> containerConfiguration=(Map<String,Object>)dockerContainersContent.get(containerName);
  if (containerConfiguration == null) {
    return;
  }
  CreateContainerResponse createContainer=this.dockerClientExecutor.createContainer(containerName,containerConfiguration);
  dockerClientExecutor.startContainer(createContainer,containerConfiguration);
  if (!AwaitStrategyFactory.create(this.dockerClientExecutor,createContainer,containerConfiguration).await()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerName));
  }
  containerMapping.addContainer(containerName,createContainer.getId());
}

Fixed version (ground truth):
public void startDockerImage(@Observes BeforeStart event,CubeConfiguration cubeConfiguration,ContainerMapping containerMapping){
  Map<String,Object> dockerContainersContent=cubeConfiguration.getDockerContainersContent();
  Container container=getContainerByDeployableContainer(event.getDeployableContainer());
  String containerName=container.getName();
  @SuppressWarnings("String_Node_Str") Map<String,Object> containerConfiguration=(Map<String,Object>)dockerContainersContent.get(containerName);
  if (containerConfiguration == null) {
    return;
  }
  log.fine(String.format("String_Node_Str",containerName,containerConfiguration));
  CreateContainerResponse createContainer=this.dockerClientExecutor.createContainer(containerName,containerConfiguration);
  log.fine(String.format("String_Node_Str",createContainer.getId()));
  dockerClientExecutor.startContainer(createContainer,containerConfiguration);
  if (!AwaitStrategyFactory.create(this.dockerClientExecutor,createContainer,containerConfiguration).await()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerName));
  }
  containerMapping.addContainer(containerName,createContainer.getId());
}
Program: 59358
Project: 59358
Buggy source:
@Override public void register(ExtensionBuilder builder){
  builder.observer(CubeConfigurator.class).observer(CubeClientCreator.class).observer(CubeRegistrar.class).observer(CubeLifecycleController.class).observer(CubeSuiteLifecycleController.class).observer(CubeContainerLifecycleController.class);
  builder.observer(ProtocolMetadataUpdater.class);
  builder.service(ResourceProvider.class,CubeIDResourceProvider.class);
  builder.service(ResourceProvider.class,CubeResourceProvider.class);
}

Fixed version (ground truth):
@Override public void register(ExtensionBuilder builder){
  builder.observer(CubeConfigurator.class).observer(CubeClientCreator.class).observer(CubeRegistrar.class).observer(CubeLifecycleController.class).observer(CubeSuiteLifecycleController.class).observer(CubeContainerLifecycleController.class).observer(RemapContainerController.class);
  builder.observer(ProtocolMetadataUpdater.class);
  builder.service(ResourceProvider.class,CubeIDResourceProvider.class);
  builder.service(ResourceProvider.class,CubeResourceProvider.class);
}
Program: 59359
Project: 59359
Buggy source:
public void startCubeMappedContainer(@Observes BeforeStart event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry){
  Container container=getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  controlEvent.fire(new CreateCube(cube));
  controlEvent.fire(new StartCube(cube));
}

Fixed version (ground truth):
public void startCubeMappedContainer(@Observes BeforeStart event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry){
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  controlEvent.fire(new CreateCube(cube));
  controlEvent.fire(new StartCube(cube));
}
Program: 59360
Project: 59360
Buggy source:
public void stopCubeMappedContainer(@Observes AfterStop event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry){
  Container container=getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  controlEvent.fire(new StopCube(cube));
  controlEvent.fire(new DestroyCube(cube));
}

Fixed version (ground truth):
public void stopCubeMappedContainer(@Observes AfterStop event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry){
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  controlEvent.fire(new StopCube(cube));
  controlEvent.fire(new DestroyCube(cube));
}
Program: 59361
Project: 59361
Buggy source:
public void remapContainer(@Observes BeforeSetup event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry){
  Container container=getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  ContainerDef containerConfiguration=container.getContainerConfiguration();
  Map<String,String> containerProperties=containerConfiguration.getContainerProperties();
  Binding binding=BindingUtil.binding(cube.configuration());
  Set<Entry<String,String>> properties=containerProperties.entrySet();
  for (  Entry<String,String> property : properties) {
    if (property.getKey().matches("String_Node_Str")) {
      int containerPort=Integer.parseInt(property.getValue());
      PortBinding bindingForExposedPort=null;
      if ((bindingForExposedPort=binding.getBindingForExposedPort(containerPort)) != null) {
        containerConfiguration.overrideProperty(property.getKey(),Integer.toString(bindingForExposedPort.getBindingPort()));
      }
    }
  }
}

Fixed version (ground truth):
public void remapContainer(@Observes BeforeSetup event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry) throws InstantiationException, IllegalAccessException {
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  Cube cube=cubeRegistry.getCube(container.getName());
  if (cube == null) {
    return;
  }
  Binding binding=BindingUtil.binding(cube.configuration());
  ContainerDef containerConfiguration=container.getContainerConfiguration();
  List<String> portPropertiesFromArquillianConfigurationFile=filterArquillianConfigurationPropertiesByPortAttribute(containerConfiguration);
  Class<?> configurationClass=container.getDeployableContainer().getConfigurationClass();
  List<PropertyDescriptor> configurationClassPortFields=filterConfigurationClassPropertiesByPortAttribute(configurationClass);
  Object newConfigurationInstance=configurationClass.newInstance();
  for (  PropertyDescriptor configurationClassPortField : configurationClassPortFields) {
    if (!portPropertiesFromArquillianConfigurationFile.contains(configurationClassPortField.getName())) {
      int containerPort=getDefaultPortFromConfigurationInstance(newConfigurationInstance,configurationClass,configurationClassPortField);
      PortBinding bindingForExposedPort=null;
      if ((bindingForExposedPort=binding.getBindingForExposedPort(containerPort)) != null) {
        containerConfiguration.overrideProperty(configurationClassPortField.getName(),Integer.toString(bindingForExposedPort.getBindingPort()));
      }
    }
  }
}
Program: 59362
Project: 59362
Buggy source:
@Test public void shouldRemapContainerPortIfItIsEqualToExposedOne(){
  Map<String,String> containerConfig=new HashMap<String,String>();
  containerConfig.put("String_Node_Str","String_Node_Str");
  when(containerDef.getContainerProperties()).thenReturn(containerConfig);
  fire(new BeforeSetup(deployableContainer));
  verify(containerDef).overrideProperty("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldRemapContainerPortIfItIsEqualToExposedOne(){
  Map<String,String> containerConfig=new HashMap<String,String>();
  when(containerDef.getContainerProperties()).thenReturn(containerConfig);
  fire(new BeforeSetup(deployableContainer));
  verify(containerDef).overrideProperty("String_Node_Str","String_Node_Str");
}
Program: 59363
Project: 59363
Buggy source:
@Before public void setup(){
  Yaml yaml=new Yaml();
  @SuppressWarnings("String_Node_Str") Map<String,Object> content=(Map<String,Object>)yaml.load(CONTENT);
  when(cube.getId()).thenReturn(CUBE_ID);
  when(cube.configuration()).thenReturn(content);
  when(container.getName()).thenReturn(CUBE_ID);
  when(container.getDeployableContainer()).thenReturn(deployableContainer);
  when(container.getContainerConfiguration()).thenReturn(containerDef);
  when(containerRegistry.getContainers()).thenReturn(Arrays.asList(container));
  registry=new DockerCubeRegistry();
  registry.addCube(cube);
  bind(ApplicationScoped.class,CubeRegistry.class,registry);
  bind(ApplicationScoped.class,ContainerRegistry.class,containerRegistry);
}

Fixed version (ground truth):
@Before public void setup(){
  Yaml yaml=new Yaml();
  @SuppressWarnings("String_Node_Str") Map<String,Object> content=(Map<String,Object>)yaml.load(CONTENT);
  when(cube.getId()).thenReturn(CUBE_ID);
  when(cube.configuration()).thenReturn(content);
  when(container.getName()).thenReturn(CUBE_ID);
  when(container.getDeployableContainer()).thenReturn(deployableContainer);
  when(deployableContainer.getConfigurationClass()).thenReturn(ContainerConfiguration.class);
  when(container.getContainerConfiguration()).thenReturn(containerDef);
  when(containerRegistry.getContainers()).thenReturn(Arrays.asList(container));
  registry=new DockerCubeRegistry();
  registry.addCube(cube);
  bind(ApplicationScoped.class,CubeRegistry.class,registry);
  bind(ApplicationScoped.class,ContainerRegistry.class,containerRegistry);
}
Program: 59364
Project: 59364
Buggy source:
public static final AwaitStrategy create(DockerClientExecutor dockerClientExecutor,CreateContainerResponse createContainerResponse,Map<String,Object> options){
  if (options.containsKey(AWAIT)) {
    Map<String,Object> awaitOptions=(Map<String,Object>)options.get(AWAIT);
    if (awaitOptions.containsKey(STRATEGY)) {
      String strategy=((String)awaitOptions.get(STRATEGY)).toLowerCase();
switch (strategy) {
case PollingAwaitStrategy.TAG:
        return new PollingAwaitStrategy(dockerClientExecutor,createContainerResponse);
case NativeAwaitStrategy.TAG:
      return new NativeAwaitStrategy(dockerClientExecutor,createContainerResponse);
case StaticAwaitStrategy.TAG:
    return new StaticAwaitStrategy(awaitOptions);
default :
  return new NativeAwaitStrategy(dockerClientExecutor,createContainerResponse);
}
}
 else {
return new NativeAwaitStrategy(dockerClientExecutor,createContainerResponse);
}
}
 else {
return new NativeAwaitStrategy(dockerClientExecutor,createContainerResponse);
}
}

Fixed version (ground truth):
public static final AwaitStrategy create(DockerClientExecutor dockerClientExecutor,String containerId,Map<String,Object> options){
  if (options.containsKey(AWAIT)) {
    Map<String,Object> awaitOptions=(Map<String,Object>)options.get(AWAIT);
    if (awaitOptions.containsKey(STRATEGY)) {
      String strategy=((String)awaitOptions.get(STRATEGY)).toLowerCase();
switch (strategy) {
case PollingAwaitStrategy.TAG:
        return new PollingAwaitStrategy(dockerClientExecutor,containerId);
case NativeAwaitStrategy.TAG:
      return new NativeAwaitStrategy(dockerClientExecutor,containerId);
case StaticAwaitStrategy.TAG:
    return new StaticAwaitStrategy(awaitOptions);
default :
  return new NativeAwaitStrategy(dockerClientExecutor,containerId);
}
}
 else {
log.warning("String_Node_Str");
return new NativeAwaitStrategy(dockerClientExecutor,containerId);
}
}
 else {
log.warning("String_Node_Str");
return new NativeAwaitStrategy(dockerClientExecutor,containerId);
}
}
Program: 59365
Project: 59365
Buggy source:
@Override public boolean await(){
  if (this.dockerClientExecutor.waitContainer(this.createContainerResponse) == 0) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean await(){
  if (this.dockerClientExecutor.waitContainer(this.containerId) == 0) {
    return true;
  }
 else {
    return false;
  }
}
Program: 59366
Project: 59366
Buggy source:
public NativeAwaitStrategy(DockerClientExecutor dockerClientExecutor,CreateContainerResponse createContainerResponse){
  this.dockerClientExecutor=dockerClientExecutor;
  this.createContainerResponse=createContainerResponse;
}

Fixed version (ground truth):
public NativeAwaitStrategy(DockerClientExecutor dockerClientExecutor,String containerId){
  this.dockerClientExecutor=dockerClientExecutor;
  this.containerId=containerId;
}
Program: 59367
Project: 59367
Buggy source:
@Override public boolean await(){
  InspectContainerResponse inspectContainer=this.dockerClientExecutor.inspectContainer(this.createContainer);
  HostConfig hostConfig=inspectContainer.getHostConfig();
  Ports portBindings=hostConfig.getPortBindings();
  Map<ExposedPort,Binding> bindings=portBindings.getBindings();
  NetworkSettings networkSettings=inspectContainer.getNetworkSettings();
  for (  Map.Entry<ExposedPort,Binding> binding : bindings.entrySet()) {
    log.fine(String.format("String_Node_Str",networkSettings.getGateway(),binding.getValue().getHostPort()));
    if (!Ping.ping(networkSettings.getGateway(),binding.getValue().getHostPort(),DEFAULT_POLL_ITERATIONS,DEFAULT_SLEEP_POLL_TIME,TimeUnit.MILLISECONDS)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean await(){
  InspectContainerResponse inspectContainer=this.dockerClientExecutor.inspectContainer(this.containerId);
  HostConfig hostConfig=inspectContainer.getHostConfig();
  Ports portBindings=hostConfig.getPortBindings();
  Map<ExposedPort,Binding> bindings=portBindings.getBindings();
  NetworkSettings networkSettings=inspectContainer.getNetworkSettings();
  for (  Map.Entry<ExposedPort,Binding> binding : bindings.entrySet()) {
    log.fine(String.format("String_Node_Str",networkSettings.getGateway(),binding.getValue().getHostPort()));
    if (!Ping.ping(networkSettings.getGateway(),binding.getValue().getHostPort(),DEFAULT_POLL_ITERATIONS,DEFAULT_SLEEP_POLL_TIME,TimeUnit.MILLISECONDS)) {
      return false;
    }
  }
  return true;
}
Program: 59368
Project: 59368
Buggy source:
public PollingAwaitStrategy(DockerClientExecutor dockerClientExecutor,CreateContainerResponse createContainer){
  this.dockerClientExecutor=dockerClientExecutor;
  this.createContainer=createContainer;
}

Fixed version (ground truth):
public PollingAwaitStrategy(DockerClientExecutor dockerClientExecutor,String containerId){
  this.dockerClientExecutor=dockerClientExecutor;
  this.containerId=containerId;
}
Program: 59369
Project: 59369
Buggy source:
public void startDockerImage(@Observes BeforeStart event,CubeConfiguration cubeConfiguration,ContainerMapping containerMapping){
  Map<String,Object> dockerContainersContent=cubeConfiguration.getDockerContainersContent();
  Container container=getContainerByDeployableContainer(event.getDeployableContainer());
  String containerName=container.getName();
  @SuppressWarnings("String_Node_Str") Map<String,Object> containerConfiguration=(Map<String,Object>)dockerContainersContent.get(containerName);
  if (containerConfiguration == null) {
    return;
  }
  log.fine(String.format("String_Node_Str",containerName,containerConfiguration));
  CreateContainerResponse createContainer=this.dockerClientExecutor.createContainer(containerName,containerConfiguration);
  log.fine(String.format("String_Node_Str",createContainer.getId()));
  dockerClientExecutor.startContainer(createContainer,containerConfiguration);
  if (!AwaitStrategyFactory.create(this.dockerClientExecutor,createContainer,containerConfiguration).await()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerName));
  }
  containerMapping.addContainer(containerName,createContainer.getId());
}

Fixed version (ground truth):
public void startDockerImage(@Observes BeforeStart event,CubeConfiguration cubeConfiguration,ContainerMapping containerMapping){
  Map<String,Object> dockerContainersContent=cubeConfiguration.getDockerContainersContent();
  Container container=getContainerByDeployableContainer(event.getDeployableContainer());
  String containerName=container.getName();
  @SuppressWarnings("String_Node_Str") Map<String,Object> containerConfiguration=(Map<String,Object>)dockerContainersContent.get(containerName);
  if (containerConfiguration == null) {
    return;
  }
  log.fine(String.format("String_Node_Str",containerName,containerConfiguration));
  String containerId=this.dockerClientExecutor.createContainer(containerName,containerConfiguration);
  log.fine(String.format("String_Node_Str",containerId));
  dockerClientExecutor.startContainer(containerId,containerConfiguration);
  if (!AwaitStrategyFactory.create(this.dockerClientExecutor,containerId,containerConfiguration).await()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerName));
  }
  containerMapping.addContainer(containerName,containerId);
}
Program: 59370
Project: 59370
Buggy source:
public void removeContainer(CreateContainerResponse createContainerResponse){
  this.dockerClient.removeContainerCmd(createContainerResponse.getId()).exec();
}

Fixed version (ground truth):
public void removeContainer(String containerId){
  this.dockerClient.removeContainerCmd(containerId).exec();
}
Program: 59371
Project: 59371
Buggy source:
public void stopContainer(CreateContainerResponse createContainerResponse){
  this.dockerClient.stopContainerCmd(createContainerResponse.getId()).exec();
}

Fixed version (ground truth):
public void stopContainer(String containerId){
  this.dockerClient.stopContainerCmd(containerId).exec();
}
Program: 59374
Project: 59374
Buggy source:
public InspectContainerResponse inspectContainer(CreateContainerResponse createContainerResponse){
  return this.dockerClient.inspectContainerCmd(createContainerResponse.getId()).exec();
}

Fixed version (ground truth):
public InspectContainerResponse inspectContainer(String containerId){
  return this.dockerClient.inspectContainerCmd(containerId).exec();
}
Program: 59375
Project: 59375
Buggy source:
public int waitContainer(CreateContainerResponse createContainerResponse){
  return this.dockerClient.waitContainerCmd(createContainerResponse.getId()).exec();
}

Fixed version (ground truth):
public int waitContainer(String containerId){
  return this.dockerClient.waitContainerCmd(containerId).exec();
}
Program: 59376
Project: 59376
Buggy source:
@Override public void register(ExtensionBuilder builder){
  builder.observer(CubeConfigurator.class);
  builder.observer(CubeLifecycle.class);
  builder.observer(ProtocolMetadataUpdater.class);
  builder.service(TestEnricher.class,ContainerEnricher.class);
  builder.service(TestEnricher.class,CubeEnricher.class);
}

Fixed version (ground truth):
@Override public void register(ExtensionBuilder builder){
  builder.observer(CubeConfigurator.class);
  builder.observer(CubeLifecycle.class);
  builder.observer(ProtocolMetadataUpdater.class);
  builder.service(TestEnricher.class,ContainerEnricher.class);
  builder.service(ResourceProvider.class,CubeResourceProvider.class);
}
Program: 59377
Project: 59377
Buggy source:
public static Binding binding(DockerClientExecutor executor,String cubeId){
  InspectContainerResponse inspectResponse=executor.getDockerClient().inspectContainerCmd(cubeId).exec();
  ;
  HostConfig hostConfig=inspectResponse.getHostConfig();
  String gatewayIp=inspectResponse.getNetworkSettings().getGateway();
  Binding binding=new Binding(gatewayIp);
  for (  Map.Entry<ExposedPort,com.github.dockerjava.api.model.Ports.Binding> bind : hostConfig.getPortBindings().getBindings().entrySet()) {
    binding.addPortBinding(bind.getKey().getPort(),bind.getValue().getHostPort());
  }
  return binding;
}

Fixed version (ground truth):
public static Binding binding(Map<String,Object> cubeConfiguration){
  Binding binding=new Binding(NO_GATEWAY);
  if (cubeConfiguration.containsKey("String_Node_Str")) {
    @SuppressWarnings("String_Node_Str") List<Map<String,Object>> cubePortBindings=(List<Map<String,Object>>)cubeConfiguration.get("String_Node_Str");
    for (    Map<String,Object> cubePortBinding : cubePortBindings) {
      if (cubePortBinding.containsKey("String_Node_Str") && cubePortBinding.containsKey("String_Node_Str")) {
        String exposedPortAndProtocol=(String)cubePortBinding.get("String_Node_Str");
        int exposedPort=Integer.parseInt(exposedPortAndProtocol.substring(0,exposedPortAndProtocol.indexOf("String_Node_Str")));
        int port=(int)cubePortBinding.get("String_Node_Str");
        binding.addPortBinding(exposedPort,port);
      }
    }
  }
  return binding;
}
Program: 59379
Project: 59379
Buggy source:
public DockerClientExecutor(CubeConfiguration cubeConfiguration){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(cubeConfiguration.getDockerServerUri());
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
}

Fixed version (ground truth):
public DockerClientExecutor(CubeConfiguration cubeConfiguration){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(cubeConfiguration.getDockerServerUri());
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}
Program: 59380
Project: 59380
Buggy source:
public static CubeConfiguration fromMap(Map<String,String> map){
  CubeConfiguration cubeConfiguration=new CubeConfiguration();
  if (map.containsKey(DOCKER_VERSION)) {
    cubeConfiguration.dockerServerVersion=map.get(DOCKER_VERSION);
  }
  if (map.containsKey(DOCKER_URI)) {
    cubeConfiguration.dockerServerUri=map.get(DOCKER_URI);
  }
  if (map.containsKey(DOCKER_CONTAINERS)) {
    String content=map.get(DOCKER_CONTAINERS);
    cubeConfiguration.dockerContainersContent=(Map<String,Object>)new Yaml().load(content);
  }
  if (map.containsKey(DOCKER_CONTAINERS_FILE)) {
    String location=map.get(DOCKER_CONTAINERS_FILE);
    try {
      cubeConfiguration.dockerContainersContent=(Map<String,Object>)new Yaml().load(new FileInputStream(location));
    }
 catch (    FileNotFoundException e) {
      throw new IllegalArgumentException(e);
    }
  }
  return cubeConfiguration;
}

Fixed version (ground truth):
public static CubeConfiguration fromMap(Map<String,String> map){
  CubeConfiguration cubeConfiguration=new CubeConfiguration();
  if (map.containsKey(DOCKER_VERSION)) {
    cubeConfiguration.dockerServerVersion=map.get(DOCKER_VERSION);
  }
  if (map.containsKey(DOCKER_URI)) {
    cubeConfiguration.dockerServerUri=map.get(DOCKER_URI);
  }
  if (map.containsKey(DOCKER_REGISTRY)) {
    cubeConfiguration.dockerRegistry=map.get(DOCKER_REGISTRY);
  }
  if (map.containsKey(DOCKER_CONTAINERS)) {
    String content=map.get(DOCKER_CONTAINERS);
    cubeConfiguration.dockerContainersContent=(Map<String,Object>)new Yaml().load(content);
  }
  if (map.containsKey(DOCKER_CONTAINERS_FILE)) {
    String location=map.get(DOCKER_CONTAINERS_FILE);
    try {
      cubeConfiguration.dockerContainersContent=(Map<String,Object>)new Yaml().load(new FileInputStream(location));
    }
 catch (    FileNotFoundException e) {
      throw new IllegalArgumentException(e);
    }
  }
  return cubeConfiguration;
}