nus-yam/ex-repair huggingface dataset:
Program: 59298
Project: 59298
Buggy source:
public void startContainer(String id,Map<String,Object> containerConfiguration){
  StartContainerCmd startContainerCmd=this.dockerClient.startContainerCmd(id);
  if (containerConfiguration.containsKey(BINDS)) {
    List<String> binds=asListOfString(containerConfiguration,BINDS);
    startContainerCmd.withBinds(toBinds(binds));
  }
  if (containerConfiguration.containsKey(LINKS)) {
    startContainerCmd.withLinks(toLinks(asListOfString(containerConfiguration,LINKS)));
  }
  if (containerConfiguration.containsKey(PORT_BINDINGS)) {
    List<String> portBindings=asListOfString(containerConfiguration,PORT_BINDINGS);
    Ports ports=assignPorts(portBindings);
    startContainerCmd.withPortBindings(ports);
  }
  if (containerConfiguration.containsKey(PRIVILEGED)) {
    startContainerCmd.withPrivileged(asBoolean(containerConfiguration,PRIVILEGED));
  }
  if (containerConfiguration.containsKey(PUBLISH_ALL_PORTS)) {
    startContainerCmd.withPublishAllPorts(asBoolean(containerConfiguration,PUBLISH_ALL_PORTS));
  }
  if (containerConfiguration.containsKey(NETWORK_MODE)) {
    startContainerCmd.withNetworkMode(asString(containerConfiguration,NETWORK_MODE));
  }
  if (containerConfiguration.containsKey(DNS_SEARCH)) {
    List<String> dnsSearch=asListOfString(containerConfiguration,DNS_SEARCH);
    startContainerCmd.withDnsSearch(dnsSearch.toArray(new String[dnsSearch.size()]));
  }
  if (containerConfiguration.containsKey(DEVICES)) {
    List<Map<String,Object>> devices=asListOfMap(containerConfiguration,DEVICES);
    startContainerCmd.withDevices(toDevices(devices));
  }
  if (containerConfiguration.containsKey(RESTART_POLICY)) {
    Map<String,Object> restart=asMap(containerConfiguration,RESTART_POLICY);
    startContainerCmd.withRestartPolicy(toRestatPolicy(restart));
  }
  if (containerConfiguration.containsKey(CAP_ADD)) {
    List<String> capAdds=asListOfString(containerConfiguration,CAP_ADD);
    startContainerCmd.withCapAdd(toCapability(capAdds));
  }
  if (containerConfiguration.containsKey(CAP_DROP)) {
    List<String> capDrop=asListOfString(containerConfiguration,CAP_DROP);
    startContainerCmd.withCapDrop(toCapability(capDrop));
  }
  startContainerCmd.exec();
}

Fixed version (ground truth):
public void startContainer(String id,Map<String,Object> containerConfiguration){
  StartContainerCmd startContainerCmd=this.dockerClient.startContainerCmd(id);
  startContainerCmd.exec();
}
Program: 59299
Project: 59299
Buggy source:
public void configure(@Observes ManagerStarted managerStarted){
  boot2DockerInstanceProducer.set(new Boot2Docker(new CommandLineExecutor()));
}

Fixed version (ground truth):
public void configure(@Observes(precedence=100) ManagerStarted managerStarted){
  boot2DockerInstanceProducer.set(new Boot2Docker(new CommandLineExecutor()));
}
Program: 59300
Project: 59300
Buggy source:
public void createClient(@Observes CubeConfiguration cubeConfiguration){
  dockerClientExecutorProducer.set(new DockerClientExecutor(cubeConfiguration,new CommandLineExecutor(),new OperatingSystemResolver()));
}

Fixed version (ground truth):
public void createClient(@Observes CubeConfiguration cubeConfiguration){
  dockerClientExecutorProducer.set(new DockerClientExecutor(cubeConfiguration,boot2DockerInstance.get(),new OperatingSystemResolver()));
}
Program: 59301
Project: 59301
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(ClientCubeControllerCreator.class).observer(BeforeStopContainerObserver.class);
  builder.service(ResourceProvider.class,CubeResourceProvider.class);
  builder.service(ResourceProvider.class,CubeControllerProvider.class);
  if (Validate.classExists("String_Node_Str")) {
    builder.observer(ProtocolMetadataUpdater.class).observer(CubeContainerLifecycleController.class).observer(RemapContainerController.class).observer(CubeRemoteCommandObserver.class);
    builder.service(AuxiliaryArchiveAppender.class,CubeAuxiliaryArchiveAppender.class);
  }
  if (Validate.classExists("String_Node_Str")) {
    builder.service(ResourceProvider.class,CubeIDResourceProvider.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(ClientCubeControllerCreator.class).observer(BeforeStopContainerObserver.class).observer(Boot2DockerCreator.class);
  builder.service(ResourceProvider.class,CubeResourceProvider.class);
  builder.service(ResourceProvider.class,CubeControllerProvider.class);
  if (Validate.classExists("String_Node_Str")) {
    builder.observer(ProtocolMetadataUpdater.class).observer(CubeContainerLifecycleController.class).observer(ContainerConfigurationController.class).observer(CubeRemoteCommandObserver.class);
    builder.service(AuxiliaryArchiveAppender.class,CubeAuxiliaryArchiveAppender.class);
  }
  if (Validate.classExists("String_Node_Str")) {
    builder.service(ResourceProvider.class,CubeIDResourceProvider.class);
  }
}
Program: 59303
Project: 59303
Buggy source:
private String resolveBoot2Docker(String dockerServerUri,CubeConfiguration cubeConfiguration){
  String output=commandLineExecutor.execCommand(createBoot2DockerCommand(cubeConfiguration),"String_Node_Str");
  Matcher m=IP_PATTERN.matcher(output);
  if (m.find()) {
    String ip=m.group();
    return dockerServerUri.replace(BOOT2DOCKER_TAG,ip);
  }
 else {
    String errorMessage=String.format("String_Node_Str",output);
    log.log(Level.SEVERE,errorMessage);
    throw new IllegalArgumentException(errorMessage);
  }
}

Fixed version (ground truth):
private String resolveBoot2Docker(String tag,CubeConfiguration cubeConfiguration){
  return tag.replaceAll(BOOT2DOCKER_TAG,boot2Docker.ip(cubeConfiguration,false));
}
Program: 59304
Project: 59304
Buggy source:
public DockerClientExecutor(CubeConfiguration cubeConfiguration,CommandLineExecutor commandLineExecutor,OperatingSystemResolver operatingSystemResolver){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.commandLineExecutor=commandLineExecutor;
  this.operatingSystemResolver=operatingSystemResolver;
  String dockerServerUri=resolveServerUri(cubeConfiguration);
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
    if (cubeConfiguration.getCertPath() == null) {
      configBuilder.withDockerCertPath(HomeResolverUtil.resolveHomeDirectoryChar(getDefaultTlsDirectory()));
    }
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  if (cubeConfiguration.getUsername() != null) {
    configBuilder.withUsername(cubeConfiguration.getUsername());
  }
  if (cubeConfiguration.getPassword() != null) {
    configBuilder.withPassword(cubeConfiguration.getPassword());
  }
  if (cubeConfiguration.getEmail() != null) {
    configBuilder.withEmail(cubeConfiguration.getEmail());
  }
  if (cubeConfiguration.getCertPath() != null) {
    configBuilder.withDockerCertPath(HomeResolverUtil.resolveHomeDirectoryChar(cubeConfiguration.getCertPath()));
  }
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}

Fixed version (ground truth):
public DockerClientExecutor(CubeConfiguration cubeConfiguration,Boot2Docker boot2Docker,OperatingSystemResolver operatingSystemResolver){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.boot2Docker=boot2Docker;
  this.operatingSystemResolver=operatingSystemResolver;
  String dockerServerUri=resolveServerUri(cubeConfiguration);
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
    if (cubeConfiguration.getCertPath() == null) {
      configBuilder.withDockerCertPath(HomeResolverUtil.resolveHomeDirectoryChar(getDefaultTlsDirectory()));
    }
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  if (cubeConfiguration.getUsername() != null) {
    configBuilder.withUsername(cubeConfiguration.getUsername());
  }
  if (cubeConfiguration.getPassword() != null) {
    configBuilder.withPassword(cubeConfiguration.getPassword());
  }
  if (cubeConfiguration.getEmail() != null) {
    configBuilder.withEmail(cubeConfiguration.getEmail());
  }
  if (cubeConfiguration.getCertPath() != null) {
    configBuilder.withDockerCertPath(HomeResolverUtil.resolveHomeDirectoryChar(cubeConfiguration.getCertPath()));
  }
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}
Program: 59305
Project: 59305
Buggy source:
@Test public void shouldGetDefaultBoot2DockerIfNoServerUriUnderMacOS(){
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(map);
  when(commandLineExecutor.execCommand("String_Node_Str")).thenReturn("String_Node_Str");
  when(operatingSystemResolver.currentOperatingSystem()).thenReturn(OperatingSystem.MAC_OSX);
  DockerClientExecutor dockerClientExecutor=new DockerClientExecutor(cubeConfiguration,commandLineExecutor,operatingSystemResolver);
  assertThat(dockerClientExecutor.getDockerUri().getHost(),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldGetDefaultBoot2DockerIfNoServerUriUnderMacOS(){
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(map);
  when(commandLineExecutor.execCommand("String_Node_Str","String_Node_Str")).thenReturn("String_Node_Str");
  when(operatingSystemResolver.currentOperatingSystem()).thenReturn(OperatingSystem.MAC_OSX);
  DockerClientExecutor dockerClientExecutor=new DockerClientExecutor(cubeConfiguration,new Boot2Docker(commandLineExecutor),operatingSystemResolver);
  assertThat(dockerClientExecutor.getDockerUri().getHost(),is("String_Node_Str"));
}
Program: 59306
Project: 59306
Buggy source:
@Test public void shouldExecuteBoot2Docker(){
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(map);
  when(commandLineExecutor.execCommand("String_Node_Str")).thenReturn("String_Node_Str");
  DockerClientExecutor dockerClientExecutor=new DockerClientExecutor(cubeConfiguration,commandLineExecutor,operatingSystemResolver);
  assertThat(dockerClientExecutor.getDockerUri().getHost(),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldExecuteBoot2Docker(){
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(map);
  when(commandLineExecutor.execCommand("String_Node_Str","String_Node_Str")).thenReturn("String_Node_Str");
  DockerClientExecutor dockerClientExecutor=new DockerClientExecutor(cubeConfiguration,new Boot2Docker(commandLineExecutor),operatingSystemResolver);
  assertThat(dockerClientExecutor.getDockerUri().getHost(),is("String_Node_Str"));
}
Program: 59307
Project: 59307
Buggy source:
@Test public void shouldGetDefaultBoot2DockerIfNoServerUriUnderWindows(){
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(map);
  when(commandLineExecutor.execCommand("String_Node_Str")).thenReturn("String_Node_Str");
  when(operatingSystemResolver.currentOperatingSystem()).thenReturn(OperatingSystem.WINDOWS_7);
  DockerClientExecutor dockerClientExecutor=new DockerClientExecutor(cubeConfiguration,commandLineExecutor,operatingSystemResolver);
  assertThat(dockerClientExecutor.getDockerUri().getHost(),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldGetDefaultBoot2DockerIfNoServerUriUnderWindows(){
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(map);
  when(commandLineExecutor.execCommand("String_Node_Str","String_Node_Str")).thenReturn("String_Node_Str");
  when(operatingSystemResolver.currentOperatingSystem()).thenReturn(OperatingSystem.WINDOWS_7);
  DockerClientExecutor dockerClientExecutor=new DockerClientExecutor(cubeConfiguration,new Boot2Docker(commandLineExecutor),operatingSystemResolver);
  assertThat(dockerClientExecutor.getDockerUri().getHost(),is("String_Node_Str"));
}
Program: 59308
Project: 59308
Buggy source:
@Test public void shouldGetDefaultUnixSocketIfNoServerUriUnderLinux(){
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str","String_Node_Str");
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(map);
  when(operatingSystemResolver.currentOperatingSystem()).thenReturn(OperatingSystem.LINUX_OS);
  DockerClientExecutor dockerClientExecutor=new DockerClientExecutor(cubeConfiguration,commandLineExecutor,operatingSystemResolver);
  assertThat(dockerClientExecutor.getDockerUri(),is(URI.create("String_Node_Str")));
}

Fixed version (ground truth):
@Test public void shouldGetDefaultUnixSocketIfNoServerUriUnderLinux(){
  Map<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str","String_Node_Str");
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(map);
  when(operatingSystemResolver.currentOperatingSystem()).thenReturn(OperatingSystem.LINUX_OS);
  DockerClientExecutor dockerClientExecutor=new DockerClientExecutor(cubeConfiguration,new Boot2Docker(commandLineExecutor),operatingSystemResolver);
  assertThat(dockerClientExecutor.getDockerUri(),is(URI.create("String_Node_Str")));
}
Program: 59309
Project: 59309
Buggy source:
public void copyFromContainer(String containerId,Map<String,Object> configurationParameters) throws IOException {
  String to=null;
  String from=null;
  if (configurationParameters.containsKey(TO) && configurationParameters.containsKey(FROM)) {
    to=(String)configurationParameters.get(TO);
    from=(String)configurationParameters.get(FROM);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerId));
  }
  InputStream response=dockerClient.copyFileFromContainerCmd(containerId,from).exec();
  Path toPath=Paths.get(to);
  Files.createDirectories(toPath);
  IOUtil.untar(response,toPath.toFile());
}

Fixed version (ground truth):
public void copyFromContainer(String containerId,Map<String,Object> configurationParameters) throws IOException {
  String to=null;
  String from=null;
  if (configurationParameters.containsKey(TO) && configurationParameters.containsKey(FROM)) {
    to=(String)configurationParameters.get(TO);
    from=(String)configurationParameters.get(FROM);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerId));
  }
  InputStream response=dockerClient.copyFileFromContainerCmd(containerId,from).exec();
  Path toPath=Paths.get(to);
  File toPathFile=toPath.toFile();
  if (toPathFile.exists() && toPathFile.isFile()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",TO,toPath.normalize().toString()));
  }
  Files.createDirectories(toPath);
  IOUtil.untar(response,toPathFile);
}
Program: 59310
Project: 59310
Buggy source:
public void copyLog(String containerId,Map<String,Object> configurationParameters) throws IOException {
  String to=null;
  if (configurationParameters.containsKey(TO)) {
    to=(String)configurationParameters.get(TO);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerId));
  }
  LogContainerCmd logContainerCmd=dockerClient.logContainerCmd(containerId).withStdErr().withStdOut();
  if (configurationParameters.containsKey(FOLLOW)) {
    logContainerCmd.withFollowStream((boolean)configurationParameters.get(FOLLOW));
  }
  if (configurationParameters.containsKey(STDOUT)) {
    logContainerCmd.withStdOut((boolean)configurationParameters.get(STDOUT));
  }
  if (configurationParameters.containsKey(STDERR)) {
    logContainerCmd.withStdErr((boolean)configurationParameters.get(STDERR));
  }
  if (configurationParameters.containsKey(TIMESTAMPS)) {
    logContainerCmd.withTimestamps((boolean)configurationParameters.get(TIMESTAMPS));
  }
  if (configurationParameters.containsKey(TAIL)) {
    logContainerCmd.withTail((int)configurationParameters.get(TAIL));
  }
  InputStream log=logContainerCmd.exec();
  Path toPath=Paths.get(to);
  Path toDirectory=toPath.getParent();
  Files.createDirectories(toDirectory);
  readDockerRawStream(log,new FileOutputStream(toPath.toFile()));
}

Fixed version (ground truth):
public void copyLog(String containerId,Map<String,Object> configurationParameters) throws IOException {
  String to=null;
  if (configurationParameters.containsKey(TO)) {
    to=(String)configurationParameters.get(TO);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerId));
  }
  LogContainerCmd logContainerCmd=dockerClient.logContainerCmd(containerId).withStdErr().withStdOut();
  if (configurationParameters.containsKey(FOLLOW)) {
    logContainerCmd.withFollowStream((boolean)configurationParameters.get(FOLLOW));
  }
  if (configurationParameters.containsKey(STDOUT)) {
    logContainerCmd.withStdOut((boolean)configurationParameters.get(STDOUT));
  }
  if (configurationParameters.containsKey(STDERR)) {
    logContainerCmd.withStdErr((boolean)configurationParameters.get(STDERR));
  }
  if (configurationParameters.containsKey(TIMESTAMPS)) {
    logContainerCmd.withTimestamps((boolean)configurationParameters.get(TIMESTAMPS));
  }
  if (configurationParameters.containsKey(TAIL)) {
    logContainerCmd.withTail((int)configurationParameters.get(TAIL));
  }
  InputStream log=logContainerCmd.exec();
  Path toPath=Paths.get(to);
  File toPathFile=toPath.toFile();
  if (toPathFile.exists() && toPathFile.isDirectory()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",TO));
  }
  Path toDirectory=toPath.getParent();
  Files.createDirectories(toDirectory);
  readDockerRawStream(log,new FileOutputStream(toPathFile));
}
Program: 59311
Project: 59311
Buggy source:
public void configure(@Observes ManagerStarted managerStarted){
  boot2DockerInstanceProducer.set(new Boot2Docker(new CommandLineExecutor()));
}

Fixed version (ground truth):
public void configure(@Observes(precedence=100) ManagerStarted managerStarted){
  boot2DockerInstanceProducer.set(new Boot2Docker(new CommandLineExecutor()));
}
Program: 59312
Project: 59312
Buggy source:
private Map<String,String> resolveServerUriByOperativeSystem(Map<String,String> cubeConfiguration){
  if (!cubeConfiguration.containsKey(CubeConfiguration.DOCKER_URI)) {
    String serverUri=new OperatingSystemResolver().currentOperatingSystem().getFamily().getServerUri();
    cubeConfiguration.put(CubeConfiguration.DOCKER_URI,serverUri);
  }
  return cubeConfiguration;
}

Fixed version (ground truth):
private Map<String,String> resolveServerUriByOperativeSystem(Map<String,String> cubeConfiguration){
  if (!cubeConfiguration.containsKey(CubeConfiguration.DOCKER_URI)) {
    String serverUri=operatingSystemFamilyInstanceProducer.get().getServerUri();
    cubeConfiguration.put(CubeConfiguration.DOCKER_URI,serverUri);
  }
  return cubeConfiguration;
}
Program: 59313
Project: 59313
Buggy source:
public void configure(@Observes ArquillianDescriptor arquillianDescriptor){
  Map<String,String> config=arquillianDescriptor.extension(EXTENSION_NAME).getExtensionProperties();
  config=resolveServerUriByOperativeSystem(config);
  config=resolveServerIp(config);
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(config);
  configurationProducer.set(cubeConfiguration);
}

Fixed version (ground truth):
public void configure(@Observes ArquillianDescriptor arquillianDescriptor){
  operatingSystemFamilyInstanceProducer.set(new OperatingSystemResolver().currentOperatingSystem().getFamily());
  Map<String,String> config=arquillianDescriptor.extension(EXTENSION_NAME).getExtensionProperties();
  config=resolveServerUriByOperativeSystem(config);
  config=resolveServerIp(config);
  CubeConfiguration cubeConfiguration=CubeConfiguration.fromMap(config);
  configurationProducer.set(cubeConfiguration);
}
Program: 59314
Project: 59314
Buggy source:
public void applyDockerServerIpChange(@Observes BeforeSetup event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry,CubeConfiguration cubeConfiguration){
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  ContainerDef containerConfiguration=container.getContainerConfiguration();
  resolveConfigurationPropertiesWithDockerServerIp(containerConfiguration,cubeConfiguration);
}

Fixed version (ground truth):
public void applyDockerServerIpChange(@Observes BeforeSetup event,CubeRegistry cubeRegistry,ContainerRegistry containerRegistry,CubeConfiguration cubeConfiguration) throws InstantiationException, IllegalAccessException, MalformedURLException {
  Container container=ContainerUtil.getContainerByDeployableContainer(containerRegistry,event.getDeployableContainer());
  if (container == null) {
    return;
  }
  ContainerDef containerConfiguration=container.getContainerConfiguration();
  boolean foundAttribute=resolveConfigurationPropertiesWithDockerServerIp(containerConfiguration,cubeConfiguration);
  if (!foundAttribute) {
    if (familyInstance.get().isBoot2Docker()) {
      Class<?> configurationClass=container.getDeployableContainer().getConfigurationClass();
      List<PropertyDescriptor> configurationClassHostOrAddressFields=filterConfigurationClassPropertiesByHostOrAddressAttribute(configurationClass);
      for (      PropertyDescriptor propertyDescriptor : configurationClassHostOrAddressFields) {
        containerConfiguration.overrideProperty(propertyDescriptor.getName(),cubeConfiguration.getDockerServerIp());
      }
    }
  }
}
Program: 59315
Project: 59315
Buggy source:
private void resolveConfigurationPropertiesWithDockerServerIp(ContainerDef containerDef,CubeConfiguration cubeConfiguration){
  for (  Entry<String,String> entry : containerDef.getContainerProperties().entrySet()) {
    if (hostPattern.matcher(entry.getKey()).matches() || addressPattern.matcher(entry.getKey()).matches()) {
      if (entry.getValue().contains(CubeConfiguration.DOCKER_SERVER_IP)) {
        containerDef.overrideProperty(entry.getKey(),entry.getValue().replaceAll(CubeConfiguration.DOCKER_SERVER_IP,cubeConfiguration.getDockerServerIp()));
      }
    }
  }
}

Fixed version (ground truth):
private boolean resolveConfigurationPropertiesWithDockerServerIp(ContainerDef containerDef,CubeConfiguration cubeConfiguration){
  boolean foundAttribute=false;
  for (  Entry<String,String> entry : containerDef.getContainerProperties().entrySet()) {
    if ((hostPattern.matcher(entry.getKey()).matches() || addressPattern.matcher(entry.getKey()).matches())) {
      foundAttribute=true;
      if (entry.getValue().contains(CubeConfiguration.DOCKER_SERVER_IP)) {
        containerDef.overrideProperty(entry.getKey(),entry.getValue().replaceAll(CubeConfiguration.DOCKER_SERVER_IP,cubeConfiguration.getDockerServerIp()));
      }
    }
  }
  return foundAttribute;
}
Program: 59316
Project: 59316
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,dockerClientExecutor,awaitOptions);
case NativeAwaitStrategy.TAG:
      return new NativeAwaitStrategy(cube,dockerClientExecutor);
case StaticAwaitStrategy.TAG:
    return new StaticAwaitStrategy(cube,awaitOptions);
case SleepingAwaitStrategy.TAG:
  return new SleepingAwaitStrategy(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,dockerClientExecutor,awaitOptions);
case NativeAwaitStrategy.TAG:
      return new NativeAwaitStrategy(cube,dockerClientExecutor);
case StaticAwaitStrategy.TAG:
    return new StaticAwaitStrategy(cube,awaitOptions);
case SleepingAwaitStrategy.TAG:
  return new SleepingAwaitStrategy(cube,awaitOptions);
default :
return new NativeAwaitStrategy(cube,dockerClientExecutor);
}
}
 else {
log.fine("String_Node_Str");
return new PollingAwaitStrategy(cube,dockerClientExecutor,new HashMap<String,Object>());
}
}
 else {
log.fine("String_Node_Str");
return new PollingAwaitStrategy(cube,dockerClientExecutor,new HashMap<String,Object>());
}
}
Program: 59317
Project: 59317
Buggy source:
@Test public void should_create_native_await_strategy_if_no_strategy_is_provided(){
  @SuppressWarnings("String_Node_Str") Map<String,Object> content=(Map<String,Object>)new Yaml().load(CONTENT_WITH_NO_STRATEGY);
  @SuppressWarnings("String_Node_Str") Map<String,Object> tomcatConfig=(Map<String,Object>)content.get("String_Node_Str");
  AwaitStrategy strategy=AwaitStrategyFactory.create(null,cube,tomcatConfig);
  assertThat(strategy,instanceOf(NativeAwaitStrategy.class));
}

Fixed version (ground truth):
@Test public void should_create_native_await_strategy_if_no_strategy_is_provided(){
  @SuppressWarnings("String_Node_Str") Map<String,Object> content=(Map<String,Object>)new Yaml().load(CONTENT_WITH_NO_STRATEGY);
  @SuppressWarnings("String_Node_Str") Map<String,Object> tomcatConfig=(Map<String,Object>)content.get("String_Node_Str");
  AwaitStrategy strategy=AwaitStrategyFactory.create(null,cube,tomcatConfig);
  assertThat(strategy,instanceOf(PollingAwaitStrategy.class));
}
Program: 59318
Project: 59318
Buggy source:
private String getDefaultTlsDirectory(){
  return System.getProperty("String_Node_Str") + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str";
}

Fixed version (ground truth):
private String getDefaultTlsDirectory(){
  return "String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str";
}
Program: 59319
Project: 59319
Buggy source:
public DockerClientExecutor(CubeConfiguration cubeConfiguration,CommandLineExecutor commandLineExecutor,OperatingSystemResolver operatingSystemResolver){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.commandLineExecutor=commandLineExecutor;
  this.operatingSystemResolver=operatingSystemResolver;
  String dockerServerUri=resolveServerUri(cubeConfiguration);
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
    if (cubeConfiguration.getCertPath() == null) {
      configBuilder.withDockerCertPath(getDefaultTlsDirectory());
    }
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  if (cubeConfiguration.getUsername() != null) {
    configBuilder.withUsername(cubeConfiguration.getUsername());
  }
  if (cubeConfiguration.getPassword() != null) {
    configBuilder.withPassword(cubeConfiguration.getPassword());
  }
  if (cubeConfiguration.getEmail() != null) {
    configBuilder.withEmail(cubeConfiguration.getEmail());
  }
  if (cubeConfiguration.getCertPath() != null) {
    configBuilder.withDockerCertPath(cubeConfiguration.getCertPath());
  }
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}

Fixed version (ground truth):
public DockerClientExecutor(CubeConfiguration cubeConfiguration,CommandLineExecutor commandLineExecutor,OperatingSystemResolver operatingSystemResolver){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.commandLineExecutor=commandLineExecutor;
  this.operatingSystemResolver=operatingSystemResolver;
  String dockerServerUri=resolveServerUri(cubeConfiguration);
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
    if (cubeConfiguration.getCertPath() == null) {
      configBuilder.withDockerCertPath(HomeResolverUtil.resolveHomeDirectoryChar(getDefaultTlsDirectory()));
    }
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  if (cubeConfiguration.getUsername() != null) {
    configBuilder.withUsername(cubeConfiguration.getUsername());
  }
  if (cubeConfiguration.getPassword() != null) {
    configBuilder.withPassword(cubeConfiguration.getPassword());
  }
  if (cubeConfiguration.getEmail() != null) {
    configBuilder.withEmail(cubeConfiguration.getEmail());
  }
  if (cubeConfiguration.getCertPath() != null) {
    configBuilder.withDockerCertPath(HomeResolverUtil.resolveHomeDirectoryChar(cubeConfiguration.getCertPath()));
  }
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}
Program: 59320
Project: 59320
Buggy source:
public String execStart(String containerId,String... commands){
  ExecCreateCmdResponse execCreateCmdResponse=this.dockerClient.execCreateCmd(containerId).withAttachStdout(true).withAttachStdin(false).withAttachStderr(false).withTty().withCmd(commands).exec();
  InputStream consoleOutputStream=dockerClient.execStartCmd(execCreateCmdResponse.getId()).withDetach(false).exec();
  String output;
  try {
    output=readExecResult(consoleOutputStream);
  }
 catch (  IOException e) {
    return "String_Node_Str";
  }
  return output;
}

Fixed version (ground truth):
public String execStart(String containerId,String... commands){
  ExecCreateCmdResponse execCreateCmdResponse=this.dockerClient.execCreateCmd(containerId).withAttachStdout(true).withAttachStdin(false).withAttachStderr(false).withTty().withCmd(commands).exec();
  InputStream consoleOutputStream=dockerClient.execStartCmd(execCreateCmdResponse.getId()).withDetach(false).exec();
  String output;
  try {
    output=readDockerRawStreamToString(consoleOutputStream);
  }
 catch (  IOException e) {
    return "String_Node_Str";
  }
  return output;
}
Program: 59321
Project: 59321
Buggy source:
public void copyLog(String containerId,Map<String,Object> configurationParameters) throws IOException {
  String to=null;
  if (configurationParameters.containsKey(TO)) {
    to=(String)configurationParameters.get(TO);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerId));
  }
  LogContainerCmd logContainerCmd=dockerClient.logContainerCmd(containerId).withStdErr().withStdOut();
  if (configurationParameters.containsKey(FOLLOW)) {
    logContainerCmd.withFollowStream((boolean)configurationParameters.get(FOLLOW));
  }
  if (configurationParameters.containsKey(STDOUT)) {
    logContainerCmd.withStdOut((boolean)configurationParameters.get(STDOUT));
  }
  if (configurationParameters.containsKey(STDERR)) {
    logContainerCmd.withStdErr((boolean)configurationParameters.get(STDERR));
  }
  if (configurationParameters.containsKey(TIMESTAMPS)) {
    logContainerCmd.withTimestamps((boolean)configurationParameters.get(TIMESTAMPS));
  }
  if (configurationParameters.containsKey(TAIL)) {
    logContainerCmd.withTail((int)configurationParameters.get(TAIL));
  }
  InputStream log=logContainerCmd.exec();
  Path toPath=Paths.get(to);
  Path toDirectory=toPath.getParent();
  Files.createDirectories(toDirectory);
  String logContent=readExecResult(log);
  IOUtil.toFile(logContent,toPath.toFile());
}

Fixed version (ground truth):
public void copyLog(String containerId,Map<String,Object> configurationParameters) throws IOException {
  String to=null;
  if (configurationParameters.containsKey(TO)) {
    to=(String)configurationParameters.get(TO);
  }
 else {
    throw new IllegalArgumentException(String.format("String_Node_Str",containerId));
  }
  LogContainerCmd logContainerCmd=dockerClient.logContainerCmd(containerId).withStdErr().withStdOut();
  if (configurationParameters.containsKey(FOLLOW)) {
    logContainerCmd.withFollowStream((boolean)configurationParameters.get(FOLLOW));
  }
  if (configurationParameters.containsKey(STDOUT)) {
    logContainerCmd.withStdOut((boolean)configurationParameters.get(STDOUT));
  }
  if (configurationParameters.containsKey(STDERR)) {
    logContainerCmd.withStdErr((boolean)configurationParameters.get(STDERR));
  }
  if (configurationParameters.containsKey(TIMESTAMPS)) {
    logContainerCmd.withTimestamps((boolean)configurationParameters.get(TIMESTAMPS));
  }
  if (configurationParameters.containsKey(TAIL)) {
    logContainerCmd.withTail((int)configurationParameters.get(TAIL));
  }
  InputStream log=logContainerCmd.exec();
  Path toPath=Paths.get(to);
  Path toDirectory=toPath.getParent();
  Files.createDirectories(toDirectory);
  readDockerRawStream(log,new FileOutputStream(toPath.toFile()));
}
Program: 59322
Project: 59322
Buggy source:
public String execStart(String containerId,String... commands){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String execStart(String containerId,String... commands){
  ExecCreateCmdResponse execCreateCmdResponse=this.dockerClient.execCreateCmd(containerId).withAttachStdout(true).withAttachStdin(false).withAttachStderr(false).withTty().withCmd(commands).exec();
  InputStream consoleOutputStream=dockerClient.execStartCmd(execCreateCmdResponse.getId()).withDetach(false).exec();
  String output;
  try {
    output=readExecResult(consoleOutputStream);
  }
 catch (  IOException e) {
    return "String_Node_Str";
  }
  return output;
}
Program: 59323
Project: 59323
Buggy source:
private static boolean execContainerPing(DockerClientExecutor dockerClientExecutor,String containerId,String command){
  String result=dockerClientExecutor.execStart(containerId,command);
  try {
    int numberOfListenConnectons=Integer.parseInt(result.trim());
    return numberOfListenConnectons > 0;
  }
 catch (  NumberFormatException e) {
    return false;
  }
}

Fixed version (ground truth):
private static boolean execContainerPing(DockerClientExecutor dockerClientExecutor,String containerId,String command){
  String result=dockerClientExecutor.execStart(containerId,new String[]{"String_Node_Str","String_Node_Str",command});
  try {
    int numberOfListenConnectons=Integer.parseInt(result.trim());
    return numberOfListenConnectons > 0;
  }
 catch (  NumberFormatException e) {
    return false;
  }
}
Program: 59324
Project: 59324
Buggy source:
public DockerClientExecutor(CubeConfiguration cubeConfiguration,CommandLineExecutor commandLineExecutor,OperatingSystemResolver operatingSystemResolver){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.commandLineExecutor=commandLineExecutor;
  this.operatingSystemResolver=operatingSystemResolver;
  String dockerServerUri=resolveServerUri(cubeConfiguration);
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  if (cubeConfiguration.getUsername() != null) {
    configBuilder.withUsername(cubeConfiguration.getUsername());
  }
  if (cubeConfiguration.getPassword() != null) {
    configBuilder.withPassword(cubeConfiguration.getPassword());
  }
  if (cubeConfiguration.getEmail() != null) {
    configBuilder.withEmail(cubeConfiguration.getEmail());
  }
  if (cubeConfiguration.getCertPath() != null) {
    configBuilder.withDockerCertPath(cubeConfiguration.getCertPath());
  }
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}

Fixed version (ground truth):
public DockerClientExecutor(CubeConfiguration cubeConfiguration,CommandLineExecutor commandLineExecutor,OperatingSystemResolver operatingSystemResolver){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.commandLineExecutor=commandLineExecutor;
  this.operatingSystemResolver=operatingSystemResolver;
  String dockerServerUri=resolveServerUri(cubeConfiguration);
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
    if (cubeConfiguration.getCertPath() == null) {
      configBuilder.withDockerCertPath(getDefaultTlsDirectory());
    }
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  if (cubeConfiguration.getUsername() != null) {
    configBuilder.withUsername(cubeConfiguration.getUsername());
  }
  if (cubeConfiguration.getPassword() != null) {
    configBuilder.withPassword(cubeConfiguration.getPassword());
  }
  if (cubeConfiguration.getEmail() != null) {
    configBuilder.withEmail(cubeConfiguration.getEmail());
  }
  if (cubeConfiguration.getCertPath() != null) {
    configBuilder.withDockerCertPath(cubeConfiguration.getCertPath());
  }
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}
Program: 59327
Project: 59327
Buggy source:
public DockerClientExecutor(CubeConfiguration cubeConfiguration,CommandLineExecutor commandLineExecutor,OperatingSystemResolver operatingSystemResolver){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.commandLineExecutor=commandLineExecutor;
  this.operatingSystemResolver=operatingSystemResolver;
  String dockerServerUri=resolveServerUri(cubeConfiguration);
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}

Fixed version (ground truth):
public DockerClientExecutor(CubeConfiguration cubeConfiguration,CommandLineExecutor commandLineExecutor,OperatingSystemResolver operatingSystemResolver){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.commandLineExecutor=commandLineExecutor;
  this.operatingSystemResolver=operatingSystemResolver;
  String dockerServerUri=resolveServerUri(cubeConfiguration);
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  if (cubeConfiguration.getUsername() != null) {
    configBuilder.withUsername(cubeConfiguration.getUsername());
  }
  if (cubeConfiguration.getPassword() != null) {
    configBuilder.withPassword(cubeConfiguration.getPassword());
  }
  if (cubeConfiguration.getEmail() != null) {
    configBuilder.withEmail(cubeConfiguration.getEmail());
  }
  if (cubeConfiguration.getCertPath() != null) {
    configBuilder.withDockerCertPath(cubeConfiguration.getCertPath());
  }
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}
Program: 59328
Project: 59328
Buggy source:
public void createClient(@Observes CubeConfiguration cubeConfiguration){
  dockerClientExecutorProducer.set(new DockerClientExecutor(cubeConfiguration));
}

Fixed version (ground truth):
public void createClient(@Observes CubeConfiguration cubeConfiguration){
  dockerClientExecutorProducer.set(new DockerClientExecutor(cubeConfiguration,new CommandLineExecutor()));
}
Program: 59329
Project: 59329
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"));
  }
  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;
}

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(BOOT2DOCKER_PATH)) {
    cubeConfiguration.boot2DockerPath=map.get(BOOT2DOCKER_PATH);
  }
  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: 59330
Project: 59330
Buggy source:
public DockerClientExecutor(CubeConfiguration cubeConfiguration){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  dockerUri=URI.create(cubeConfiguration.getDockerServerUri());
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}

Fixed version (ground truth):
public DockerClientExecutor(CubeConfiguration cubeConfiguration,CommandLineExecutor commandLineExecutor){
  DockerClientConfigBuilder configBuilder=DockerClientConfig.createDefaultConfigBuilder();
  this.commandLineExecutor=commandLineExecutor;
  String dockerServerUri=cubeConfiguration.getDockerServerUri();
  if (dockerServerUri.contains(BOOT2DOCKER_TAG)) {
    dockerServerUri=resolveBoot2Docker(dockerServerUri,cubeConfiguration);
  }
  dockerUri=URI.create(dockerServerUri);
  configBuilder.withVersion(cubeConfiguration.getDockerServerVersion()).withUri(dockerUri.toString());
  this.dockerClient=DockerClientBuilder.getInstance(configBuilder.build()).build();
  this.cubeConfiguration=cubeConfiguration;
}
Program: 59332
Project: 59332
Buggy source:
private void startAllSteps(List<String[]> autoStartSteps,boolean allowToConnectToRunningContainers){
  for (  final String[] cubeIds : autoStartSteps) {
    Map<String,Future<RuntimeException>> stepStatus=new HashMap<>();
    for (    final String cubeId : cubeIds) {
      Future<RuntimeException> result=executorServiceInst.get().submit(new StartCubes(cubeId,allowToConnectToRunningContainers));
      stepStatus.put(cubeId,result);
    }
    waitForCompletion(stepStatus,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void startAllSteps(List<String[]> autoStartSteps,ConnectionMode connectionMode){
  for (  final String[] cubeIds : autoStartSteps) {
    Map<String,Future<RuntimeException>> stepStatus=new HashMap<>();
    for (    final String cubeId : cubeIds) {
      Future<RuntimeException> result=executorServiceInst.get().submit(new StartCubes(cubeId,connectionMode));
      stepStatus.put(cubeId,result);
    }
    waitForCompletion(stepStatus,"String_Node_Str");
  }
}
Program: 59333
Project: 59333
Buggy source:
public void startAutoContainers(@Observes(precedence=100) BeforeSuite event,final CubeConfiguration configuration){
  List<String[]> autoStartSteps=AutoStartOrderUtil.getAutoStartOrder(configuration);
  startAllSteps(autoStartSteps,configuration.shouldAllowToConnectToRunningContainers());
}

Fixed version (ground truth):
public void startAutoContainers(@Observes(precedence=100) BeforeSuite event,final CubeConfiguration configuration){
  List<String[]> autoStartSteps=AutoStartOrderUtil.getAutoStartOrder(configuration);
  startAllSteps(autoStartSteps,configuration.getConnectionMode());
}
Program: 59334
Project: 59334
Buggy source:
private StartCubes(String cubeId,boolean shouldAllowToConnectToRunningContainers){
  this.cubeId=cubeId;
  this.allowToConnectToRunningContainers=shouldAllowToConnectToRunningContainers;
}

Fixed version (ground truth):
private StartCubes(String cubeId,ConnectionMode connectionMode){
  this.cubeId=cubeId;
  this.connectionMode=connectionMode;
}