Program: 91765
Project: 91765
Buggy source:
public IDockerHostConfig getDockerHostConfig(){
  final ImageRunSelectionModel selectionModel=this.imageRunSelectionPage.getModel();
  final ImageRunResourceVolumesVariablesModel resourcesModel=this.imageRunResourceVolumesPage.getModel();
  final DockerHostConfig.Builder hostConfigBuilder=new DockerHostConfig.Builder();
  if (selectionModel.isPublishAllPorts()) {
    hostConfigBuilder.publishAllPorts(true);
  }
 else {
    final Map<String,List<IDockerPortBinding>> portBindings=new HashMap<>();
    for (Iterator<ExposedPortModel> iterator=selectionModel.getExposedPorts().iterator(); iterator.hasNext(); ) {
      final ExposedPortModel exposedPort=iterator.next();
      if (!selectionModel.getSelectedPorts().contains(exposedPort)) {
        continue;
      }
      final DockerPortBinding portBinding=new DockerPortBinding(exposedPort.getHostAddress(),exposedPort.getHostPort());
      portBindings.put(exposedPort.getContainerPort() + exposedPort.getPortType(),Arrays.<IDockerPortBinding>asList(portBinding));
    }
    hostConfigBuilder.portBindings(portBindings);
  }
  final List<String> links=new ArrayList<>();
  for (Iterator<ContainerLinkModel> iterator=selectionModel.getLinks().iterator(); iterator.hasNext(); ) {
    final ContainerLinkModel link=iterator.next();
    links.add(link.getContainerName() + ':' + link.getContainerAlias());
  }
  hostConfigBuilder.links(links);
  final List<String> volumesFrom=new ArrayList<>();
  final List<String> binds=new ArrayList<>();
  for (Iterator<DataVolumeModel> iterator=resourcesModel.getDataVolumes().iterator(); iterator.hasNext(); ) {
    final DataVolumeModel dataVolume=iterator.next();
    if (!resourcesModel.getSelectedDataVolumes().contains(dataVolume)) {
      continue;
    }
switch (dataVolume.getMountType()) {
case HOST_FILE_SYSTEM:
      String bind=convertToUnixPath(dataVolume.getHostPathMount()) + ':' + dataVolume.getContainerPath()+ "String_Node_Str";
    if (dataVolume.isReadOnly()) {
      bind+="String_Node_Str";
    }
  binds.add(bind);
break;
case CONTAINER:
volumesFrom.add(dataVolume.getContainerMount());
break;
default :
break;
}
}
hostConfigBuilder.binds(binds);
hostConfigBuilder.volumesFrom(volumesFrom);
if (resourcesModel.isEnableResourceLimitations()) {
hostConfigBuilder.memory(resourcesModel.getMemoryLimit() * MB);
hostConfigBuilder.cpuShares(resourcesModel.getCpuShareWeight());
}
return hostConfigBuilder.build();
}

Fixed version (ground truth):
public IDockerHostConfig getDockerHostConfig(){
  final ImageRunSelectionModel selectionModel=this.imageRunSelectionPage.getModel();
  final ImageRunResourceVolumesVariablesModel resourcesModel=this.imageRunResourceVolumesPage.getModel();
  final DockerHostConfig.Builder hostConfigBuilder=new DockerHostConfig.Builder();
  if (selectionModel.isPublishAllPorts()) {
    hostConfigBuilder.publishAllPorts(true);
  }
 else {
    final Map<String,List<IDockerPortBinding>> portBindings=new HashMap<>();
    for (Iterator<ExposedPortModel> iterator=selectionModel.getExposedPorts().iterator(); iterator.hasNext(); ) {
      final ExposedPortModel exposedPort=iterator.next();
      if (!selectionModel.getSelectedPorts().contains(exposedPort)) {
        continue;
      }
      final DockerPortBinding portBinding=new DockerPortBinding(exposedPort.getHostAddress(),exposedPort.getHostPort());
      portBindings.put(exposedPort.getContainerPort() + exposedPort.getPortType(),Arrays.<IDockerPortBinding>asList(portBinding));
    }
    hostConfigBuilder.portBindings(portBindings);
  }
  final List<String> links=new ArrayList<>();
  for (Iterator<ContainerLinkModel> iterator=selectionModel.getLinks().iterator(); iterator.hasNext(); ) {
    final ContainerLinkModel link=iterator.next();
    links.add(link.getContainerName() + ':' + link.getContainerAlias());
  }
  hostConfigBuilder.links(links);
  final List<String> volumesFrom=new ArrayList<>();
  final List<String> binds=new ArrayList<>();
  for (Iterator<DataVolumeModel> iterator=resourcesModel.getDataVolumes().iterator(); iterator.hasNext(); ) {
    final DataVolumeModel dataVolume=iterator.next();
    if (!resourcesModel.getSelectedDataVolumes().contains(dataVolume)) {
      continue;
    }
switch (dataVolume.getMountType()) {
case HOST_FILE_SYSTEM:
      String bind=LaunchConfigurationUtils.convertToUnixPath(dataVolume.getHostPathMount()) + ':' + dataVolume.getContainerPath()+ "String_Node_Str";
    if (dataVolume.isReadOnly()) {
      bind+="String_Node_Str";
    }
  binds.add(bind);
break;
case CONTAINER:
volumesFrom.add(dataVolume.getContainerMount());
break;
default :
break;
}
}
hostConfigBuilder.binds(binds);
hostConfigBuilder.volumesFrom(volumesFrom);
if (resourcesModel.isEnableResourceLimitations()) {
hostConfigBuilder.memory(resourcesModel.getMemoryLimit() * MB);
hostConfigBuilder.cpuShares(resourcesModel.getCpuShareWeight());
}
return hostConfigBuilder.build();
}