nus-yam/ex-repair huggingface dataset:
Program: 111492
Project: 111492
Buggy source:
@Test public void info() throws DockerException {
  Info dockerInfo=dockerClient.infoCmd().exec();
  LOG.info(dockerInfo.toString());
  assertTrue(dockerInfo.toString().contains("String_Node_Str"));
  assertTrue(dockerInfo.toString().contains("String_Node_Str"));
  assertTrue(dockerInfo.toString().contains("String_Node_Str"));
  assertTrue(dockerInfo.getContainers() > 0);
  assertTrue(dockerInfo.getImages() > 0);
  assertTrue(dockerInfo.getNFd() > 0);
  assertTrue(dockerInfo.getNGoroutines() > 0);
  assertTrue(dockerInfo.isMemoryLimit());
}

Fixed version (ground truth):
@Test public void info() throws DockerException {
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withName("String_Node_Str").withCmd("String_Node_Str","String_Node_Str").exec();
  LOG.info("String_Node_Str",container);
  assertThat(container.getId(),not(isEmptyOrNullString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  tmpContainers.add(container.getId());
  Info dockerInfo=dockerClient.infoCmd().exec();
  LOG.info(dockerInfo.toString());
  assertTrue(dockerInfo.toString().contains("String_Node_Str"));
  assertTrue(dockerInfo.toString().contains("String_Node_Str"));
  assertTrue(dockerInfo.toString().contains("String_Node_Str"));
  assertTrue(dockerInfo.getContainers() > 0);
  assertTrue(dockerInfo.getImages() > 0);
  assertTrue(dockerInfo.getNFd() > 0);
  assertTrue(dockerInfo.getNGoroutines() > 0);
  assertTrue(dockerInfo.isMemoryLimit());
}
Program: 111493
Project: 111493
Buggy source:
protected ClientResponse impl() throws DockerException {
  MultivaluedMap<String,String> params=new MultivaluedMapImpl();
  params.add("String_Node_Str",logs ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",timestamps ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",stdout ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",stderr ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",followStream ? "String_Node_Str" : "String_Node_Str");
  WebResource webResource=baseResource.path(String.format("String_Node_Str",containerId)).queryParams(params);
  try {
    LOGGER.trace("String_Node_Str",webResource);
    return webResource.accept(MediaType.APPLICATION_OCTET_STREAM_TYPE).post(ClientResponse.class,params);
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 400) {
      throw new DockerException("String_Node_Str");
    }
 else     if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 500) {
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
}

Fixed version (ground truth):
protected ClientResponse impl() throws DockerException {
  MultivaluedMap<String,String> params=new MultivaluedMapImpl();
  params.add("String_Node_Str",logs ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",timestamps ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",stdout ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",stderr ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",followStream ? "String_Node_Str" : "String_Node_Str");
  WebResource webResource=baseResource.path(String.format("String_Node_Str",containerId)).queryParams(params);
  try {
    LOGGER.trace("String_Node_Str",webResource);
    return webResource.accept(MediaType.APPLICATION_OCTET_STREAM_TYPE).post(ClientResponse.class);
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 400) {
      throw new DockerException("String_Node_Str");
    }
 else     if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 500) {
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
}
Program: 111494
Project: 111494
Buggy source:
protected String impl() throws DockerException {
  checkCommitConfig(commitConfig);
  MultivaluedMap<String,String> params=new MultivaluedMapImpl();
  params.add("String_Node_Str",containerId);
  params.add("String_Node_Str",repository);
  params.add("String_Node_Str",tag);
  params.add("String_Node_Str",message);
  params.add("String_Node_Str",author);
  params.add("String_Node_Str",pause ? "String_Node_Str" : "String_Node_Str");
  WebResource webResource=baseResource.path("String_Node_Str").queryParams(params);
  try {
    LOGGER.trace("String_Node_Str",webResource);
    ObjectNode ObjectNode=webResource.accept("String_Node_Str").post(ObjectNode.class,params);
    return ObjectNode.get("String_Node_Str").asText();
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 500) {
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
catch (  Exception e) {
    throw new DockerException(e);
  }
}

Fixed version (ground truth):
protected String impl() throws DockerException {
  checkCommitConfig(commitConfig);
  MultivaluedMap<String,String> params=new MultivaluedMapImpl();
  params.add("String_Node_Str",containerId);
  params.add("String_Node_Str",repository);
  params.add("String_Node_Str",tag);
  params.add("String_Node_Str",message);
  params.add("String_Node_Str",author);
  params.add("String_Node_Str",pause ? "String_Node_Str" : "String_Node_Str");
  WebResource webResource=baseResource.path("String_Node_Str").queryParams(params);
  try {
    LOGGER.trace("String_Node_Str",webResource);
    ObjectNode objectNode=webResource.queryParams(params).accept("String_Node_Str").type(MediaType.APPLICATION_JSON).post(ObjectNode.class,commitConfig);
    return objectNode.get("String_Node_Str").asText();
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 500) {
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
catch (  Exception e) {
    throw new DockerException(e);
  }
}
Program: 111495
Project: 111495
Buggy source:
@Test public void commit() throws DockerException {
  ContainerCreateResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd(new String[]{"String_Node_Str","String_Node_Str"}).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  tmpContainers.add(container.getId());
  LOG.info("String_Node_Str",container.toString());
  String imageId=dockerClient.commitCmd(container.getId()).exec();
  tmpImgs.add(imageId);
  ImageInspectResponse imageInspectResponse=dockerClient.inspectImageCmd(imageId).exec();
  LOG.info("String_Node_Str",imageInspectResponse.toString());
  assertThat(imageInspectResponse,hasField("String_Node_Str",startsWith(container.getId())));
  assertThat(imageInspectResponse.getContainerConfig().getImage(),equalTo("String_Node_Str"));
  ImageInspectResponse busyboxImg=dockerClient.inspectImageCmd("String_Node_Str").exec();
  assertThat(imageInspectResponse.getParent(),equalTo(busyboxImg.getId()));
}

Fixed version (ground truth):
@Test public void commit() throws DockerException {
  ContainerCreateResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str","String_Node_Str").exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  tmpContainers.add(container.getId());
  LOG.info("String_Node_Str",container.toString());
  String imageId=dockerClient.commitCmd(container.getId()).exec();
  tmpImgs.add(imageId);
  ImageInspectResponse imageInspectResponse=dockerClient.inspectImageCmd(imageId).exec();
  LOG.info("String_Node_Str",imageInspectResponse.toString());
  assertThat(imageInspectResponse,hasField("String_Node_Str",startsWith(container.getId())));
  assertThat(imageInspectResponse.getContainerConfig().getImage(),equalTo("String_Node_Str"));
  ImageInspectResponse busyboxImg=dockerClient.inspectImageCmd("String_Node_Str").exec();
  assertThat(imageInspectResponse.getParent(),equalTo(busyboxImg.getId()));
}
Program: 111496
Project: 111496
Buggy source:
protected Void impl() throws DockerException {
  WebResource webResource=baseResource.path(String.format("String_Node_Str",containerId));
  try {
    LOGGER.trace("String_Node_Str",webResource);
    Builder builder=webResource.accept(MediaType.TEXT_PLAIN);
    if (startContainerConfig != null) {
      builder.type(MediaType.APPLICATION_JSON).post(startContainerConfig);
    }
 else {
      builder.post((StartContainerConfig)null);
    }
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 304) {
      LOGGER.warn("String_Node_Str",containerId);
    }
 else     if (exception.getResponse().getStatus() == 204) {
      LOGGER.trace("String_Node_Str",containerId);
    }
 else     if (exception.getResponse().getStatus() == 500) {
      LOGGER.error("String_Node_Str",exception);
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
  return null;
}

Fixed version (ground truth):
protected Void impl() throws DockerException {
  WebResource webResource=baseResource.path(String.format("String_Node_Str",containerId));
  try {
    LOGGER.trace("String_Node_Str",webResource);
    Builder builder=webResource.accept(MediaType.APPLICATION_JSON);
    if (startContainerConfig != null) {
      builder.type(MediaType.APPLICATION_JSON).post(startContainerConfig);
    }
 else {
      builder.post((StartContainerConfig)null);
    }
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 304) {
      LOGGER.warn("String_Node_Str",containerId);
    }
 else     if (exception.getResponse().getStatus() == 204) {
      LOGGER.trace("String_Node_Str",containerId);
    }
 else     if (exception.getResponse().getStatus() == 500) {
      LOGGER.error("String_Node_Str",exception);
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
  return null;
}
Program: 111497
Project: 111497
Buggy source:
@Test public void startContainerWithPortBindings() throws DockerException {
  ExposedPort tcp22=ExposedPort.tcp(22);
  ExposedPort tcp23=ExposedPort.tcp(23);
  ContainerCreateResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str").withExposedPorts(tcp22,tcp23).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  ContainerInspectResponse containerInspectResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  Ports portBindings=new Ports();
  portBindings.bind(tcp22,Ports.Binding(11022));
  portBindings.bind(tcp23,Ports.Binding(11023));
  dockerClient.startContainerCmd(container.getId()).withPortBindings(portBindings).exec();
  containerInspectResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertThat(containerInspectResponse.getState().isRunning(),is(true));
  assertThat(Arrays.asList(containerInspectResponse.getConfig().getExposedPorts()),contains(tcp22,tcp23));
  assertThat(containerInspectResponse.getHostConfig().getPortBindings().getBindings().get(tcp22),is(equalTo(Ports.Binding("String_Node_Str",11022))));
  assertThat(containerInspectResponse.getHostConfig().getPortBindings().getBindings().get(tcp23),is(equalTo(Ports.Binding("String_Node_Str",11023))));
  tmpContainers.add(container.getId());
}

Fixed version (ground truth):
@Test public void startContainerWithPortBindings() throws DockerException {
  ExposedPort tcp22=ExposedPort.tcp(22);
  ExposedPort tcp23=ExposedPort.tcp(23);
  ContainerCreateResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str").withExposedPorts(tcp22,tcp23).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  ContainerInspectResponse containerInspectResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  Ports portBindings=new Ports();
  portBindings.bind(tcp22,Ports.Binding(11022));
  portBindings.bind(tcp23,Ports.Binding(11023));
  dockerClient.startContainerCmd(container.getId()).withPortBindings(portBindings).exec();
  containerInspectResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertThat(Arrays.asList(containerInspectResponse.getConfig().getExposedPorts()),contains(tcp22,tcp23));
  assertThat(containerInspectResponse.getHostConfig().getPortBindings().getBindings().get(tcp22),is(equalTo(Ports.Binding("String_Node_Str",11022))));
  assertThat(containerInspectResponse.getHostConfig().getPortBindings().getBindings().get(tcp23),is(equalTo(Ports.Binding("String_Node_Str",11023))));
  tmpContainers.add(container.getId());
}
Program: 111498
Project: 111498
Buggy source:
protected Void impl() throws DockerException {
  WebResource webResource=baseResource.path(String.format("String_Node_Str",containerId));
  try {
    LOGGER.trace("String_Node_Str",webResource);
    Builder builder=webResource.accept(MediaType.TEXT_PLAIN);
    if (startContainerConfig != null) {
      builder.type(MediaType.APPLICATION_JSON).post(startContainerConfig);
    }
 else {
      builder.post((StartContainerConfig)null);
    }
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 204) {
      LOGGER.trace("String_Node_Str",containerId);
    }
 else     if (exception.getResponse().getStatus() == 500) {
      LOGGER.error("String_Node_Str",exception);
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
  return null;
}

Fixed version (ground truth):
protected Void impl() throws DockerException {
  WebResource webResource=baseResource.path(String.format("String_Node_Str",containerId));
  try {
    LOGGER.trace("String_Node_Str",webResource);
    Builder builder=webResource.accept(MediaType.APPLICATION_JSON);
    if (startContainerConfig != null) {
      builder.type(MediaType.APPLICATION_JSON).post(startContainerConfig);
    }
 else {
      builder.post((StartContainerConfig)null);
    }
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 204) {
      LOGGER.trace("String_Node_Str",containerId);
    }
 else     if (exception.getResponse().getStatus() == 500) {
      LOGGER.error("String_Node_Str",exception);
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
  return null;
}
Program: 111499
Project: 111499
Buggy source:
public ClientResponse handle(ClientRequest cr){
  ClientResponse resp=getNext().handle(cr);
  String respContentType=resp.getHeaders().getFirst("String_Node_Str");
  if (respContentType.startsWith("String_Node_Str")) {
    String newContentType="String_Node_Str" + respContentType.substring(10);
    resp.getHeaders().putSingle("String_Node_Str",newContentType);
  }
  return resp;
}

Fixed version (ground truth):
public ClientResponse handle(ClientRequest cr){
  ClientResponse resp=getNext().handle(cr);
  String respContentType=resp.getHeaders().getFirst("String_Node_Str");
  if (respContentType != null && respContentType.startsWith("String_Node_Str")) {
    String newContentType="String_Node_Str" + respContentType.substring(10);
    resp.getHeaders().putSingle("String_Node_Str",newContentType);
  }
  return resp;
}
Program: 111500
Project: 111500
Buggy source:
protected ClientResponse impl() throws DockerException {
  MultivaluedMap<String,String> params=new MultivaluedMapImpl();
  params.add("String_Node_Str","String_Node_Str");
  params.add("String_Node_Str",timestamps ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",stdout ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",stderr ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",followStream ? "String_Node_Str" : "String_Node_Str");
  WebResource webResource=baseResource.path(String.format("String_Node_Str",containerId)).queryParams(params);
  try {
    LOGGER.trace("String_Node_Str",webResource);
    return webResource.accept(MediaType.APPLICATION_OCTET_STREAM_TYPE).post(ClientResponse.class,params);
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 400) {
      throw new DockerException("String_Node_Str");
    }
 else     if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 500) {
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
}

Fixed version (ground truth):
protected ClientResponse impl() throws DockerException {
  MultivaluedMap<String,String> params=new MultivaluedMapImpl();
  params.add("String_Node_Str",timestamps ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",stdout ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",stderr ? "String_Node_Str" : "String_Node_Str");
  params.add("String_Node_Str",followStream ? "String_Node_Str" : "String_Node_Str");
  WebResource webResource=baseResource.path(String.format("String_Node_Str",containerId)).queryParams(params);
  try {
    LOGGER.trace("String_Node_Str",webResource);
    return webResource.accept(MediaType.APPLICATION_OCTET_STREAM_TYPE).get(ClientResponse.class);
  }
 catch (  UniformInterfaceException exception) {
    if (exception.getResponse().getStatus() == 400) {
      throw new DockerException("String_Node_Str");
    }
 else     if (exception.getResponse().getStatus() == 404) {
      throw new NotFoundException(String.format("String_Node_Str",containerId));
    }
 else     if (exception.getResponse().getStatus() == 500) {
      throw new DockerException("String_Node_Str",exception);
    }
 else {
      throw new DockerException(exception);
    }
  }
}
Program: 111501
Project: 111501
Buggy source:
public Ports getPorts(){
  return ports;
}

Fixed version (ground truth):
public Port[] getPorts(){
  return ports;
}
Program: 111502
Project: 111502
Buggy source:
public void setPorts(Ports ports){
  this.ports=ports;
}

Fixed version (ground truth):
public void setPorts(Port[] ports){
  this.ports=ports;
}
Program: 111503
Project: 111503
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + id + '\''+ "String_Node_Str"+ command+ '\''+ "String_Node_Str"+ image+ '\''+ "String_Node_Str"+ created+ "String_Node_Str"+ status+ '\''+ "String_Node_Str"+ ports+ "String_Node_Str"+ size+ "String_Node_Str"+ sizeRootFs+ "String_Node_Str"+ Arrays.toString(names)+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + ip + '\''+ "String_Node_Str"+ privatePort+ '\''+ "String_Node_Str"+ publicPort+ '\''+ "String_Node_Str"+ type+ '\''+ '}';
}
Program: 111504
Project: 111504
Buggy source:
@Test public void removeContainer() throws DockerClientException {
  ContainerConfig containerConfig=new ContainerConfig.Builder("String_Node_Str").cmd(new String[]{"String_Node_Str"}).build();
  ContainerCreateResponse container=dockerClient.createContainer(containerConfig);
  dockerClient.startContainer(container.id);
  dockerClient.waitContainer(container.id);
  tmpContainers.add(container.id);
  LOG.info("String_Node_Str" + container.id);
  dockerClient.removeContainer(container.id);
  List containers2=dockerClient.listContainers(true);
  assertThat(containers2,not(hasItem(hasField("String_Node_Str",startsWith(container.id)))));
}

Fixed version (ground truth):
@Test public void removeContainer() throws DockerClientException {
  ContainerConfig containerConfig=new ContainerConfig.Builder("String_Node_Str").cmd(new String[]{"String_Node_Str"}).build();
  ContainerCreateResponse container=dockerClient.createContainer(containerConfig);
  dockerClient.startContainer(container.id);
  dockerClient.waitContainer(container.id);
  tmpContainers.add(container.id);
  LOG.info("String_Node_Str" + container.id);
  dockerClient.removeContainer(container.id);
  List containers2=dockerClient.listContainers(true);
  Matcher matcher=not(hasItem(hasField("String_Node_Str",startsWith(container.id))));
  assertThat(containers2,matcher);
}
Program: 111505
Project: 111505
Buggy source:
@Test public void testListContainers() throws DockerClientException {
  List<Container> containers=dockerClient.listContainers(true);
  assertThat(containers,notNullValue());
  LOG.info("String_Node_Str" + containers);
  int size=containers.size();
  ContainerConfig containerConfig=new ContainerConfig.Builder("String_Node_Str").cmd(new String[]{"String_Node_Str"}).build();
  ContainerCreateResponse container1=dockerClient.createContainer(containerConfig);
  assertThat(container1.id,not(isEmptyString()));
  dockerClient.startContainer(container1.id);
  tmpContainers.add(container1.id);
  List containers2=dockerClient.listContainers(true);
  assertThat(size + 1,is(equalTo(containers2.size())));
  assertThat(containers2,hasItem(hasField("String_Node_Str",startsWith(container1.id))));
  List<Container> filteredContainers=filter(hasField("String_Node_Str",startsWith(container1.id)),containers2);
  assertThat(filteredContainers.size(),is(equalTo(1)));
  Container container2=filteredContainers.get(0);
  assertThat(container2.command,not(isEmptyString()));
  assertThat(container2.image,equalTo("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testListContainers() throws DockerClientException {
  List<Container> containers=dockerClient.listContainers(true);
  assertThat(containers,notNullValue());
  LOG.info("String_Node_Str" + containers);
  int size=containers.size();
  ContainerConfig containerConfig=new ContainerConfig.Builder("String_Node_Str").cmd(new String[]{"String_Node_Str"}).build();
  ContainerCreateResponse container1=dockerClient.createContainer(containerConfig);
  assertThat(container1.id,not(isEmptyString()));
  dockerClient.startContainer(container1.id);
  tmpContainers.add(container1.id);
  List containers2=dockerClient.listContainers(true);
  assertThat(size + 1,is(equalTo(containers2.size())));
  Matcher matcher=hasItem(hasField("String_Node_Str",startsWith(container1.id)));
  assertThat(containers2,matcher);
  List<Container> filteredContainers=filter(hasField("String_Node_Str",startsWith(container1.id)),containers2);
  assertThat(filteredContainers.size(),is(equalTo(1)));
  Container container2=filteredContainers.get(0);
  assertThat(container2.command,not(isEmptyString()));
  assertThat(container2.image,equalTo("String_Node_Str"));
}
Program: 111506
Project: 111506
Buggy source:
@Test public void testDockerSearch() throws DockerClientException {
  List dockerSearch=dockerClient.search("String_Node_Str");
  LOG.info("String_Node_Str" + dockerSearch.toString());
  assertThat(dockerSearch,hasItem(hasField("String_Node_Str",equalTo("String_Node_Str"))));
  assertThat(filter(hasField("String_Node_Str",is("String_Node_Str")),dockerSearch).size(),equalTo(1));
}

Fixed version (ground truth):
@Test public void testDockerSearch() throws DockerClientException {
  List<SearchItem> dockerSearch=dockerClient.search("String_Node_Str");
  LOG.info("String_Node_Str" + dockerSearch.toString());
  Matcher matcher=hasItem(hasField("String_Node_Str",equalTo("String_Node_Str")));
  assertThat(dockerSearch,matcher);
  assertThat(filter(hasField("String_Node_Str",is("String_Node_Str")),dockerSearch).size(),equalTo(1));
}
Program: 111507
Project: 111507
Buggy source:
@Test public void testRemoveImage() throws DockerClientException {
  ContainerConfig containerConfig=new ContainerConfig.Builder("String_Node_Str").cmd(new String[]{"String_Node_Str","String_Node_Str"}).build();
  ContainerCreateResponse container=dockerClient.createContainer(containerConfig);
  LOG.info("String_Node_Str" + container.toString());
  assertThat(container.id,not(isEmptyString()));
  dockerClient.startContainer(container.id);
  tmpContainers.add(container.id);
  LOG.info("String_Node_Str" + container.toString());
  String imageId=dockerClient.commit(new CommitConfig.Builder(container.id).build());
  tmpImgs.add(imageId);
  LOG.info("String_Node_Str" + imageId);
  dockerClient.removeImage(imageId);
  List containers=dockerClient.listContainers(true);
  assertThat(containers,not(hasItem(hasField("String_Node_Str",startsWith(imageId)))));
}

Fixed version (ground truth):
@Test public void testRemoveImage() throws DockerClientException {
  ContainerConfig containerConfig=new ContainerConfig.Builder("String_Node_Str").cmd(new String[]{"String_Node_Str","String_Node_Str"}).build();
  ContainerCreateResponse container=dockerClient.createContainer(containerConfig);
  LOG.info("String_Node_Str" + container.toString());
  assertThat(container.id,not(isEmptyString()));
  dockerClient.startContainer(container.id);
  tmpContainers.add(container.id);
  LOG.info("String_Node_Str" + container.toString());
  String imageId=dockerClient.commit(new CommitConfig.Builder(container.id).build());
  tmpImgs.add(imageId);
  LOG.info("String_Node_Str" + imageId);
  dockerClient.removeImage(imageId);
  List containers=dockerClient.listContainers(true);
  Matcher matcher=not(hasItem(hasField("String_Node_Str",startsWith(imageId))));
  assertThat(containers,matcher);
}
Program: 111508
Project: 111508
Buggy source:
public VncViewer(String[] argv){
  SecurityClient.setDefaults();
  getTimestamp();
  System.err.format("String_Node_Str");
  System.err.format(aboutText,version,build,buildDate,buildTime);
  System.err.format("String_Node_Str");
  Configuration.enableViewerParams();
  try {
    defaultServerName=loadViewerParameters(null);
  }
 catch (  com.tigervnc.rfb.Exception e) {
    defaultServerName="String_Node_Str";
    vlog.info(e.getMessage());
  }
  for (int i=0; i < argv.length; i++) {
    if (argv[i].length() == 0)     continue;
    if (argv[i].equalsIgnoreCase("String_Node_Str")) {
      if (++i >= argv.length)       usage();
      defaultServerName=loadViewerParameters(argv[i]);
      continue;
    }
    if (argv[i].equalsIgnoreCase("String_Node_Str")) {
      if (++i >= argv.length)       usage();
      System.err.println("String_Node_Str" + argv[i]);
      LogWriter.setLogParams(argv[i]);
      continue;
    }
    if (Configuration.setParam(argv[i]))     continue;
    if (argv[i].charAt(0) == '-') {
      if (i + 1 < argv.length) {
        if (Configuration.setParam(argv[i].substring(1),argv[i + 1])) {
          i++;
          continue;
        }
      }
      usage();
    }
    vncServerName.put(argv[i].toCharArray()).flip();
  }
}

Fixed version (ground truth):
public VncViewer(String[] argv){
  SecurityClient.setDefaults();
  getTimestamp();
  System.err.format("String_Node_Str");
  System.err.format(aboutText,version,build,buildDate,buildTime);
  System.err.format("String_Node_Str");
  Configuration.enableViewerParams();
  try {
    defaultServerName=loadViewerParameters(null);
  }
 catch (  com.tigervnc.rfb.Exception e) {
    defaultServerName="String_Node_Str";
    vlog.info(e.getMessage());
  }
  int i=0;
  for (; i < argv.length; i++) {
    if (argv[i].length() == 0)     continue;
    if (argv[i].equalsIgnoreCase("String_Node_Str")) {
      if (++i >= argv.length)       usage();
      defaultServerName=loadViewerParameters(argv[i]);
      continue;
    }
    if (argv[i].equalsIgnoreCase("String_Node_Str")) {
      if (++i >= argv.length)       usage();
      System.err.println("String_Node_Str" + argv[i]);
      LogWriter.setLogParams(argv[i]);
      continue;
    }
    if (argv[i].charAt(0) == '-') {
      if (i + 1 < argv.length) {
        if (Configuration.setParam(argv[i].substring(1),argv[i + 1])) {
          i++;
          continue;
        }
      }
      if (Configuration.setParam(argv[i]))       continue;
      usage();
    }
    vncServerName.put(argv[i].toCharArray()).flip();
  }
}
Program: 111510
Project: 111510
Buggy source:
private static String fillCmdPattern(String pattern,String gatewayHost,String remoteHost,int remotePort,int localPort){
  boolean H_found=false, G_found=false, R_found=false, L_found=false;
  boolean P_found=false;
  String cmd=extSSHClient.getValue() + "String_Node_Str";
  pattern.replaceAll("String_Node_Str","String_Node_Str");
  String user=getSshUser();
  int sshPort=getSshPort();
  gatewayHost=user + "String_Node_Str" + gatewayHost;
  for (int i=0; i < pattern.length(); i++) {
    if (pattern.charAt(i) == '%') {
switch (pattern.charAt(++i)) {
case 'H':
        cmd+=(tunnel.getValue() ? gatewayHost : remoteHost);
      H_found=true;
    continue;
case 'G':
  cmd+=gatewayHost;
G_found=true;
continue;
case 'R':
cmd+=remotePort;
R_found=true;
continue;
case 'L':
cmd+=localPort;
L_found=true;
continue;
case 'P':
cmd+=sshPort;
P_found=true;
continue;
}
}
cmd+=pattern.charAt(i);
}
if (pattern.length() > 1024) throw new Exception("String_Node_Str");
if (!H_found || !R_found || !L_found) throw new Exception("String_Node_Str");
if (!tunnel.getValue() && !G_found) throw new Exception("String_Node_Str");
vlog.info("String_Node_Str" + cmd);
if (VncViewer.os.startsWith("String_Node_Str")) cmd.replaceAll("String_Node_Str","String_Node_Str");
return cmd;
}

Fixed version (ground truth):
private static String fillCmdPattern(String pattern,String gatewayHost,String remoteHost,int remotePort,int localPort){
  boolean H_found=false, G_found=false, R_found=false, L_found=false;
  boolean P_found=false;
  String cmd=extSSHClient.getValue() + "String_Node_Str";
  pattern.replaceAll("String_Node_Str","String_Node_Str");
  String user=getSshUser();
  int sshPort=getSshPort();
  gatewayHost=user + "String_Node_Str" + gatewayHost;
  for (int i=0; i < pattern.length(); i++) {
    if (pattern.charAt(i) == '%') {
switch (pattern.charAt(++i)) {
case 'H':
        cmd+=remoteHost;
      H_found=true;
    continue;
case 'G':
  cmd+=gatewayHost;
G_found=true;
continue;
case 'R':
cmd+=remotePort;
R_found=true;
continue;
case 'L':
cmd+=localPort;
L_found=true;
continue;
case 'P':
cmd+=sshPort;
P_found=true;
continue;
}
}
cmd+=pattern.charAt(i);
}
if (pattern.length() > 1024) throw new Exception("String_Node_Str");
if (!H_found || !R_found || !L_found) throw new Exception("String_Node_Str");
if (!tunnel.getValue() && !G_found) throw new Exception("String_Node_Str");
vlog.info("String_Node_Str" + cmd);
if (VncViewer.os.startsWith("String_Node_Str")) cmd.replaceAll("String_Node_Str","String_Node_Str");
return cmd;
}
Program: 111511
Project: 111511
Buggy source:
private static void createTunnelExt(String gatewayHost,String remoteHost,int remotePort,int localPort,String pattern) throws Exception {
  if (pattern == null || pattern.length() < 1) {
    if (tunnel.getValue())     pattern=DEFAULT_TUNNEL_TEMPLATE;
 else     pattern=DEFAULT_VIA_TEMPLATE;
  }
  String cmd=fillCmdPattern(pattern,gatewayHost,remoteHost,remotePort,localPort);
  try {
    Thread t=new Thread(new ExtProcess(cmd,vlog,true));
    t.start();
    Thread.sleep(1000);
  }
 catch (  java.lang.Exception e) {
    throw new Exception(e.getMessage());
  }
}

Fixed version (ground truth):
private static void createTunnelExt(String gatewayHost,String remoteHost,int remotePort,int localPort,String pattern) throws Exception {
  if (pattern == null || pattern.length() < 1) {
    if (tunnel.getValue() && via.getValue().isEmpty())     pattern=DEFAULT_TUNNEL_TEMPLATE;
 else     pattern=DEFAULT_VIA_TEMPLATE;
  }
  String cmd=fillCmdPattern(pattern,gatewayHost,remoteHost,remotePort,localPort);
  try {
    Thread t=new Thread(new ExtProcess(cmd,vlog,true));
    t.start();
    Thread.sleep(1000);
  }
 catch (  java.lang.Exception e) {
    throw new Exception(e.getMessage());
  }
}
Program: 111512
Project: 111512
Buggy source:
public static void createTunnel(CConn cc,int localPort) throws Exception {
  int remotePort;
  String gatewayHost;
  String remoteHost;
  remotePort=cc.getServerPort();
  if (tunnel.getValue() && via.getValue().isEmpty()) {
    gatewayHost=cc.getServerName();
    remoteHost="String_Node_Str";
  }
 else {
    gatewayHost=getSshHost();
    remoteHost=cc.getServerName();
  }
  String pattern=extSSHArgs.getValue();
  if (pattern == null || pattern.isEmpty()) {
    if (tunnel.getValue())     pattern=System.getProperty("String_Node_Str");
 else     pattern=System.getProperty("String_Node_Str");
  }
  if (extSSH.getValue() || (pattern != null && pattern.length() > 0)) {
    createTunnelExt(gatewayHost,remoteHost,remotePort,localPort,pattern);
  }
 else {
    createTunnelJSch(gatewayHost,remoteHost,remotePort,localPort);
  }
}

Fixed version (ground truth):
public static void createTunnel(CConn cc,int localPort) throws Exception {
  int remotePort;
  String gatewayHost;
  String remoteHost;
  remotePort=cc.getServerPort();
  gatewayHost=cc.getServerName();
  remoteHost="String_Node_Str";
  if (!via.getValue().isEmpty()) {
    gatewayHost=getSshHost();
    remoteHost=cc.getServerName();
  }
  String pattern=extSSHArgs.getValue();
  if (pattern == null || pattern.isEmpty()) {
    if (tunnel.getValue() && via.getValue().isEmpty())     pattern=System.getProperty("String_Node_Str");
 else     pattern=System.getProperty("String_Node_Str");
  }
  if (extSSH.getValue() || (pattern != null && pattern.length() > 0)) {
    createTunnelExt(gatewayHost,remoteHost,remotePort,localPort,pattern);
  }
 else {
    createTunnelJSch(gatewayHost,remoteHost,remotePort,localPort);
  }
}
Program: 111513
Project: 111513
Buggy source:
public Rectangle getScreenBounds(){
  GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
  Rectangle r=new Rectangle();
  setMaximizedBounds(null);
  if (cc.viewer.fullScreenAllMonitors.getValue()) {
    for (    GraphicsDevice gd : ge.getScreenDevices())     for (    GraphicsConfiguration gc : gd.getConfigurations())     r=r.union(gc.getBounds());
    if (!cc.fullScreen)     pack();
    Rectangle mb=new Rectangle(r);
    mb.grow(getInsets().left,getInsets().bottom);
    setMaximizedBounds(mb);
  }
 else {
    GraphicsDevice gd=ge.getDefaultScreenDevice();
    GraphicsConfiguration gc=gd.getDefaultConfiguration();
    r=gc.getBounds();
  }
  return r;
}

Fixed version (ground truth):
public Rectangle getScreenBounds(){
  GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();
  Rectangle r=new Rectangle();
  setMaximizedBounds(null);
  if (cc.viewer.fullScreenAllMonitors.getValue()) {
    for (    GraphicsDevice gd : ge.getScreenDevices())     for (    GraphicsConfiguration gc : gd.getConfigurations())     r=r.union(gc.getBounds());
    Dimension d=getPreferredSize();
    if (!cc.fullScreen)     if ((d.width > 0) && (d.height > 0))     pack();
    Rectangle mb=new Rectangle(r);
    mb.grow(getInsets().left,getInsets().bottom);
    setMaximizedBounds(mb);
  }
 else {
    GraphicsDevice gd=ge.getDefaultScreenDevice();
    GraphicsConfiguration gc=gd.getDefaultConfiguration();
    r=gc.getBounds();
  }
  return r;
}
Program: 111515
Project: 111515
Buggy source:
public boolean processMsg(CConnection cc){
  is=(FdInStream)cc.getInStream();
  os=(FdOutStream)cc.getOutStream();
  client=cc;
  initGlobal();
  if (session == null) {
    if (!is.checkNoWait(1))     return false;
    if (is.readU8() == 0) {
      int result=is.readU32();
      String reason;
      if (result == Security.secResultFailed || result == Security.secResultTooMany)       reason=is.readString();
 else       reason=new String("String_Node_Str");
      throw new AuthFailureException(reason);
    }
    setParam();
  }
  try {
    manager=new SSLEngineManager(engine,is,os);
    manager.doHandshake();
  }
 catch (  java.lang.Exception e) {
    throw new Exception(e.getMessage());
  }
  cc.setStreams(new TLSInStream(is,manager),new TLSOutStream(os,manager));
  return true;
}

Fixed version (ground truth):
public boolean processMsg(CConnection cc){
  is=(FdInStream)cc.getInStream();
  os=(FdOutStream)cc.getOutStream();
  client=cc;
  initGlobal();
  if (session == null) {
    if (!is.checkNoWait(1))     return false;
    if (is.readU8() == 0) {
      int result=is.readU32();
      String reason;
      if (result == Security.secResultFailed || result == Security.secResultTooMany)       reason=is.readString();
 else       reason=new String("String_Node_Str");
      throw new AuthFailureException(reason);
    }
    setParam();
  }
  try {
    manager=new SSLEngineManager(engine,is,os);
    manager.doHandshake();
  }
 catch (  java.lang.Exception e) {
    if (e.getMessage().equals("String_Node_Str"))     throw new WarningException(e.getMessage());
 else     throw new SystemException(e.toString());
  }
  cc.setStreams(new TLSInStream(is,manager),new TLSOutStream(os,manager));
  return true;
}
Program: 111517
Project: 111517
Buggy source:
public void run(){
  cc=null;
  if (listenMode.getValue()) {
    int port=5500;
    if (vncServerName.getValue() != null && Character.isDigit(vncServerName.getValue().charAt(0)))     port=Integer.parseInt(vncServerName.getValue());
    TcpListener listener=null;
    try {
      listener=new TcpListener(null,port);
    }
 catch (    java.lang.Exception e) {
      reportException(e);
      exit(1);
    }
    vlog.info("String_Node_Str" + port);
    while (true) {
      Socket new_sock=listener.accept();
      if (new_sock != null)       newViewer(this,new_sock);
    }
  }
  try {
    cc=new CConn(this,sock,vncServerName.getValue());
    while (!cc.shuttingDown)     cc.processMsg();
  }
 catch (  java.lang.Exception e) {
    if (cc == null || !cc.shuttingDown) {
      reportException(e);
      if (cc != null)       cc.deleteWindow();
      exit(1);
    }
 else     if (embed.getValue()) {
      reportException(new java.lang.Exception("String_Node_Str"));
    }
 else {
      cc=null;
    }
  }
  exit(0);
}

Fixed version (ground truth):
public void run(){
  cc=null;
  if (listenMode.getValue()) {
    int port=5500;
    if (vncServerName.getValue() != null && Character.isDigit(vncServerName.getValue().charAt(0)))     port=Integer.parseInt(vncServerName.getValue());
    TcpListener listener=null;
    try {
      listener=new TcpListener(null,port);
    }
 catch (    java.lang.Exception e) {
      reportException(e);
      exit(1);
    }
    vlog.info("String_Node_Str" + port);
    while (true) {
      Socket new_sock=listener.accept();
      if (new_sock != null)       newViewer(this,new_sock,true);
    }
  }
  try {
    cc=new CConn(this,sock,vncServerName.getValue());
    while (!cc.shuttingDown)     cc.processMsg();
  }
 catch (  java.lang.Exception e) {
    if (cc == null || !cc.shuttingDown) {
      reportException(e);
      if (cc != null)       cc.deleteWindow();
      exit(1);
    }
 else     if (embed.getValue()) {
      reportException(new java.lang.Exception("String_Node_Str"));
    }
 else {
      cc=null;
    }
  }
  exit(0);
}
Program: 111518
Project: 111518
Buggy source:
void showInfo(){
  Window fullScreenWindow=Viewport.getFullScreenWindow();
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(null);
  String info=new String("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  String msg=String.format(info,cp.name(),sock.getPeerName(),sock.getPeerPort(),cp.width,cp.height,desktop.getPF().print(),serverPF.print(),Encodings.encodingName(currentEncoding),Encodings.encodingName(lastServerEncoding),sock.inStream().kbitsPerSecond(),cp.majorVersion,cp.minorVersion,Security.secTypeName(csecurity.getType()),csecurity.description());
  JOptionPane op=new JOptionPane(msg,JOptionPane.PLAIN_MESSAGE,JOptionPane.DEFAULT_OPTION);
  JDialog dlg=op.createDialog(desktop,"String_Node_Str");
  dlg.setIconImage(VncViewer.frameIcon);
  dlg.setVisible(true);
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(fullScreenWindow);
}

Fixed version (ground truth):
void showInfo(){
  Window fullScreenWindow=Viewport.getFullScreenWindow();
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(null);
  String info=new String("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  String msg=String.format(info,cp.name(),sock.getPeerName(),sock.getPeerPort(),cp.width,cp.height,desktop.getPF().print(),serverPF.print(),Encodings.encodingName(currentEncoding),Encodings.encodingName(lastServerEncoding),sock.inStream().kbitsPerSecond(),cp.majorVersion,cp.minorVersion,Security.secTypeName(csecurity.getType()),csecurity.description());
  JOptionPane op=new JOptionPane(msg,JOptionPane.PLAIN_MESSAGE,JOptionPane.DEFAULT_OPTION);
  JDialog dlg=op.createDialog(desktop,"String_Node_Str");
  dlg.setIconImage(VncViewer.frameIcon);
  dlg.setAlwaysOnTop(true);
  dlg.setVisible(true);
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(fullScreenWindow);
}
Program: 111519
Project: 111519
Buggy source:
void showAbout(){
  String pkgDate="String_Node_Str";
  String pkgTime="String_Node_Str";
  try {
    Manifest manifest=new Manifest(VncViewer.timestamp);
    Attributes attributes=manifest.getMainAttributes();
    pkgDate=attributes.getValue("String_Node_Str");
    pkgTime=attributes.getValue("String_Node_Str");
  }
 catch (  IOException e) {
  }
  Window fullScreenWindow=Viewport.getFullScreenWindow();
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(null);
  String msg=String.format(VncViewer.aboutText,VncViewer.version,VncViewer.build,VncViewer.buildDate,VncViewer.buildTime);
  JOptionPane op=new JOptionPane(msg,JOptionPane.INFORMATION_MESSAGE,JOptionPane.DEFAULT_OPTION,VncViewer.logoIcon);
  JDialog dlg=op.createDialog(desktop,"String_Node_Str");
  dlg.setIconImage(VncViewer.frameIcon);
  dlg.setVisible(true);
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(fullScreenWindow);
}

Fixed version (ground truth):
void showAbout(){
  String pkgDate="String_Node_Str";
  String pkgTime="String_Node_Str";
  try {
    Manifest manifest=new Manifest(VncViewer.timestamp);
    Attributes attributes=manifest.getMainAttributes();
    pkgDate=attributes.getValue("String_Node_Str");
    pkgTime=attributes.getValue("String_Node_Str");
  }
 catch (  IOException e) {
  }
  Window fullScreenWindow=Viewport.getFullScreenWindow();
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(null);
  String msg=String.format(VncViewer.aboutText,VncViewer.version,VncViewer.build,VncViewer.buildDate,VncViewer.buildTime);
  JOptionPane op=new JOptionPane(msg,JOptionPane.INFORMATION_MESSAGE,JOptionPane.DEFAULT_OPTION,VncViewer.logoIcon);
  JDialog dlg=op.createDialog(desktop,"String_Node_Str");
  dlg.setIconImage(VncViewer.frameIcon);
  dlg.setAlwaysOnTop(true);
  dlg.setVisible(true);
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(fullScreenWindow);
}
Program: 111520
Project: 111520
Buggy source:
public void endDialog(){
  setVisible(false);
  setFocusable(false);
  setAlwaysOnTop(false);
  fullScreenWindow=Viewport.getFullScreenWindow();
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(fullScreenWindow);
}

Fixed version (ground truth):
public void endDialog(){
  setVisible(false);
  setAlwaysOnTop(false);
  fullScreenWindow=Viewport.getFullScreenWindow();
  if (fullScreenWindow != null)   Viewport.setFullScreenWindow(fullScreenWindow);
}
Program: 111521
Project: 111521
Buggy source:
public synchronized void checkClipboard(){
  SecurityManager sm=System.getSecurityManager();
  try {
    if (sm != null)     sm.checkSystemClipboardAccess();
    Clipboard cb=Toolkit.getDefaultToolkit().getSystemClipboard();
    if (cb == null)     return;
    Transferable t=cb.getContents(null);
    if ((t != null) && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
      try {
        String newContents=new String("String_Node_Str");
        if (t.getTransferData(DataFlavor.stringFlavor) != null) {
          int len=Math.min(cc.viewer.maxCutText.getValue(),((String)t.getTransferData(DataFlavor.stringFlavor)).length());
          newContents=((String)t.getTransferData(DataFlavor.stringFlavor)).substring(0,len);
        }
        if (!newContents.equals(cc.clipboardDialog.getContents())) {
          if (cc.viewer.sendClipboard.getValue())           cc.writeClientCutText(newContents,newContents.length());
          cc.clipboardDialog.setContents(newContents);
        }
      }
 catch (      java.lang.Exception e) {
        vlog.debug("String_Node_Str" + e.getMessage());
      }
    }
  }
 catch (  SecurityException e) {
    vlog.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
public synchronized void checkClipboard(){
  SecurityManager sm=System.getSecurityManager();
  try {
    if (sm != null)     sm.checkSystemClipboardAccess();
    Clipboard cb=Toolkit.getDefaultToolkit().getSystemClipboard();
    if (cb != null) {
      Transferable t=cb.getContents(null);
      if (t == null)       return;
      DataFlavor flavor=DataFlavor.selectBestTextFlavor(t.getTransferDataFlavors());
      if (flavor == null)       return;
      BufferedReader br=new BufferedReader(flavor.getReaderForText(t));
      CharBuffer cbuf=CharBuffer.allocate(VncViewer.maxCutText.getValue());
      br.read(cbuf);
      cbuf.flip();
      String newContents=cbuf.toString();
      if (!cc.clipboardDialog.compareContentsTo(newContents)) {
        cc.clipboardDialog.setContents(newContents);
        if (cc.viewer.sendClipboard.getValue())         cc.writeClientCutText(newContents,newContents.length());
      }
      br.close();
      System.gc();
    }
  }
 catch (  java.lang.Exception e) {
    vlog.debug("String_Node_Str" + e.getMessage());
  }
}
Program: 111522
Project: 111522
Buggy source:
synchronized void releaseModifiers(){
  if ((modifiers & Event.SHIFT_MASK) != 0)   writeKeyEvent(Keysyms.Shift_L,false);
  if ((modifiers & Event.CTRL_MASK) != 0)   writeKeyEvent(Keysyms.Control_L,false);
  if ((modifiers & Event.ALT_MASK) != 0)   writeKeyEvent(Keysyms.Alt_L,false);
  if ((modifiers & Event.META_MASK) != 0)   writeKeyEvent(Keysyms.Meta_L,false);
  modifiers=0;
}

Fixed version (ground truth):
synchronized void releaseModifiers(){
  if ((modifiers & Event.SHIFT_MASK) == Event.SHIFT_MASK)   writeKeyEvent(Keysyms.Shift_R,false);
  if (((modifiers >> KEY_LOC_SHIFT_L) & Event.SHIFT_MASK) == Event.SHIFT_MASK)   writeKeyEvent(Keysyms.Shift_L,false);
  if ((modifiers & Event.CTRL_MASK) == Event.CTRL_MASK)   writeKeyEvent(Keysyms.Control_R,false);
  if (((modifiers >> KEY_LOC_SHIFT_L) & Event.CTRL_MASK) == Event.CTRL_MASK)   writeKeyEvent(Keysyms.Control_L,false);
  if ((modifiers & Event.ALT_MASK) == Event.ALT_MASK)   writeKeyEvent(Keysyms.Alt_R,false);
  if (((modifiers >> KEY_LOC_SHIFT_L) & Event.ALT_MASK) == Event.ALT_MASK)   writeKeyEvent(Keysyms.Alt_L,false);
  if ((modifiers & Event.META_MASK) == Event.META_MASK)   writeKeyEvent(Keysyms.Meta_R,false);
  if (((modifiers >> KEY_LOC_SHIFT_L) & Event.META_MASK) == Event.META_MASK)   writeKeyEvent(Keysyms.Meta_L,false);
  if ((modifiers & SUPER_MASK) == SUPER_MASK)   writeKeyEvent(Keysyms.Super_L,false);
  modifiers=0;
}