nus-yam/ex-repair huggingface dataset:
Program: 111397
Project: 111397
Buggy source:
@Test public void startContainerWithVolumes() throws DockerException {
  Volume volume1=new Volume("String_Node_Str");
  Volume volume2=new Volume("String_Node_Str");
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withVolumes(volume1,volume2).withCmd("String_Node_Str").withBinds(new Bind("String_Node_Str",volume1,ro),new Bind("String_Node_Str",volume2)).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  InspectContainerResponse inspectContainerResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertThat(inspectContainerResponse.getConfig().getVolumes().keySet(),contains("String_Node_Str","String_Node_Str"));
  dockerClient.startContainerCmd(container.getId()).exec();
  dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  inspectContainerResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertContainerHasVolumes(inspectContainerResponse,volume1,volume2);
  assertThat(Arrays.asList(inspectContainerResponse.getVolumesRW()),contains(new VolumeRW(volume1,AccessMode.ro),new VolumeRW(volume2)));
}

Fixed version (ground truth):
@Test public void startContainerWithVolumes() throws DockerException {
  Volume volume1=new Volume("String_Node_Str");
  Volume volume2=new Volume("String_Node_Str");
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withVolumes(volume1,volume2).withCmd("String_Node_Str").withBinds(new Bind("String_Node_Str",volume1,ro),new Bind("String_Node_Str",volume2)).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  InspectContainerResponse inspectContainerResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertThat(inspectContainerResponse.getConfig().getVolumes().keySet(),contains("String_Node_Str","String_Node_Str"));
  dockerClient.startContainerCmd(container.getId()).exec();
  dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  inspectContainerResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertContainerHasVolumes(inspectContainerResponse,volume1,volume2);
  assertEquals(inspectContainerResponse.getMounts().size(),2);
  assertEquals(inspectContainerResponse.getMounts().get(0).getDestination(),volume1);
  assertEquals(inspectContainerResponse.getMounts().get(0).getMode(),"String_Node_Str");
  assertEquals(inspectContainerResponse.getMounts().get(0).getRW(),Boolean.FALSE);
  assertEquals(inspectContainerResponse.getMounts().get(1).getDestination(),volume2);
  assertEquals(inspectContainerResponse.getMounts().get(1).getMode(),"String_Node_Str");
  assertEquals(inspectContainerResponse.getMounts().get(1).getRW(),Boolean.TRUE);
}
Program: 111398
Project: 111398
Buggy source:
/** 
 * @throws NotFoundException container not found
 */
@Override public Integer exec() throws NotFoundException ;

Fixed version (ground truth):
/** 
 * @throws NotFoundException container not found
 */
@Override public <T extends ResultCallback<WaitResponse>>T exec(T resultCallback);
Program: 111399
Project: 111399
Buggy source:
@Override public void onError(Throwable throwable){
  if (closed)   return;
  try {
    LOGGER.error("String_Node_Str",throwable);
    throw new RuntimeException(throwable);
  }
  finally {
    try {
      close();
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
@Override public void onError(Throwable throwable){
  if (closed)   return;
  if (this.firstError == null)   this.firstError=throwable;
  try {
    LOGGER.error("String_Node_Str",throwable);
  }
  finally {
    try {
      close();
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 111400
Project: 111400
Buggy source:
@Test public void testRunShlex() throws DockerException {
  String[] commands=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (  String command : commands) {
    LOG.info("String_Node_Str",command);
    CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd(commands).exec();
    dockerClient.startContainerCmd(container.getId());
    int exitcode=dockerClient.waitContainerCmd(container.getId()).exec();
    assertThat(exitcode,equalTo(0));
  }
}

Fixed version (ground truth):
@Test public void testRunShlex() throws DockerException {
  String[] commands=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (  String command : commands) {
    LOG.info("String_Node_Str",command);
    CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd(commands).exec();
    dockerClient.startContainerCmd(container.getId());
    int exitcode=dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
    assertThat(exitcode,equalTo(0));
  }
}
Program: 111401
Project: 111401
Buggy source:
private String execBuild(BuildImageCmd buildImageCmd) throws Exception {
  String imageId=buildImageCmd.withNoCache().exec(new BuildImageResultCallback()).awaitImageId();
  CreateContainerResponse container=dockerClient.createContainerCmd(imageId).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  dockerClient.waitContainerCmd(container.getId()).exec();
  return containerLog(container.getId());
}

Fixed version (ground truth):
private String execBuild(BuildImageCmd buildImageCmd) throws Exception {
  String imageId=buildImageCmd.withNoCache().exec(new BuildImageResultCallback()).awaitImageId();
  CreateContainerResponse container=dockerClient.createContainerCmd(imageId).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  return containerLog(container.getId());
}
Program: 111402
Project: 111402
Buggy source:
@Test(groups="String_Node_Str") public void testContainerDiff() throws DockerException {
  CreateContainerResponse 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();
  int exitCode=dockerClient.waitContainerCmd(container.getId()).exec();
  assertThat(exitCode,equalTo(0));
  List<ChangeLog> filesystemDiff=dockerClient.containerDiffCmd(container.getId()).exec();
  LOG.info("String_Node_Str",filesystemDiff.toString());
  assertThat(filesystemDiff.size(),equalTo(1));
  ChangeLog testChangeLog=selectUnique(filesystemDiff,hasField("String_Node_Str",equalTo("String_Node_Str")));
  assertThat(testChangeLog,hasField("String_Node_Str",equalTo("String_Node_Str")));
  assertThat(testChangeLog,hasField("String_Node_Str",equalTo(1)));
}

Fixed version (ground truth):
@Test(groups="String_Node_Str") public void testContainerDiff() throws DockerException {
  CreateContainerResponse 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();
  int exitCode=dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  assertThat(exitCode,equalTo(0));
  List<ChangeLog> filesystemDiff=dockerClient.containerDiffCmd(container.getId()).exec();
  LOG.info("String_Node_Str",filesystemDiff.toString());
  assertThat(filesystemDiff.size(),equalTo(1));
  ChangeLog testChangeLog=selectUnique(filesystemDiff,hasField("String_Node_Str",equalTo("String_Node_Str")));
  assertThat(testChangeLog,hasField("String_Node_Str",equalTo("String_Node_Str")));
  assertThat(testChangeLog,hasField("String_Node_Str",equalTo(1)));
}
Program: 111403
Project: 111403
Buggy source:
@Test public void canCloseFrameReaderAndReadExpectedLines() throws Exception {
  int exitCode=dockerClient.waitContainerCmd(dockerfileFixture.getContainerId()).exec();
  assertEquals(0,exitCode);
  Iterator<Frame> response=getLoggingFrames().iterator();
  assertEquals(response.next(),new Frame(StreamType.STDOUT,"String_Node_Str".getBytes()));
  assertEquals(response.next(),new Frame(StreamType.STDERR,"String_Node_Str".getBytes()));
  assertFalse(response.hasNext());
}

Fixed version (ground truth):
@Test public void canCloseFrameReaderAndReadExpectedLines() throws Exception {
  int exitCode=dockerClient.waitContainerCmd(dockerfileFixture.getContainerId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  assertEquals(0,exitCode);
  Iterator<Frame> response=getLoggingFrames().iterator();
  assertEquals(response.next(),new Frame(StreamType.STDOUT,"String_Node_Str".getBytes()));
  assertEquals(response.next(),new Frame(StreamType.STDERR,"String_Node_Str".getBytes()));
  assertFalse(response.hasNext());
}
Program: 111404
Project: 111404
Buggy source:
@Test public void asyncMultipleLogContainer() throws Exception {
  String snippet="String_Node_Str";
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str",snippet).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  int exitCode=dockerClient.waitContainerCmd(container.getId()).exec();
  assertThat(exitCode,equalTo(0));
  LogContainerTestCallback loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().exec(loggingCallback);
  loggingCallback.close();
  loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().exec(loggingCallback);
  loggingCallback.close();
  loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().exec(loggingCallback);
  loggingCallback.awaitCompletion();
  assertTrue(loggingCallback.toString().contains(snippet));
}

Fixed version (ground truth):
@Test public void asyncMultipleLogContainer() throws Exception {
  String snippet="String_Node_Str";
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str",snippet).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  int exitCode=dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  assertThat(exitCode,equalTo(0));
  LogContainerTestCallback loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().exec(loggingCallback);
  loggingCallback.close();
  loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().exec(loggingCallback);
  loggingCallback.close();
  loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().exec(loggingCallback);
  loggingCallback.awaitCompletion();
  assertTrue(loggingCallback.toString().contains(snippet));
}
Program: 111405
Project: 111405
Buggy source:
@Test public void asyncLogContainer() throws Exception {
  String snippet="String_Node_Str";
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str",snippet).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  int exitCode=dockerClient.waitContainerCmd(container.getId()).exec();
  assertThat(exitCode,equalTo(0));
  LogContainerTestCallback loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().exec(loggingCallback);
  loggingCallback.awaitCompletion();
  assertTrue(loggingCallback.toString().contains(snippet));
}

Fixed version (ground truth):
@Test public void asyncLogContainer() throws Exception {
  String snippet="String_Node_Str";
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str",snippet).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  dockerClient.startContainerCmd(container.getId()).exec();
  int exitCode=dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  assertThat(exitCode,equalTo(0));
  LogContainerTestCallback loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().exec(loggingCallback);
  loggingCallback.awaitCompletion();
  assertTrue(loggingCallback.toString().contains(snippet));
}
Program: 111406
Project: 111406
Buggy source:
@Test public void asyncLogContainerWithSince() throws Exception {
  String snippet="String_Node_Str";
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str",snippet).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  int timestamp=(int)(System.currentTimeMillis() / 1000);
  dockerClient.startContainerCmd(container.getId()).exec();
  int exitCode=dockerClient.waitContainerCmd(container.getId()).exec();
  assertThat(exitCode,equalTo(0));
  LogContainerTestCallback loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().withSince(timestamp).exec(loggingCallback);
  loggingCallback.awaitCompletion();
  assertFalse(loggingCallback.toString().contains(snippet));
}

Fixed version (ground truth):
@Test public void asyncLogContainerWithSince() throws Exception {
  String snippet="String_Node_Str";
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str",snippet).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  int timestamp=(int)(System.currentTimeMillis() / 1000);
  dockerClient.startContainerCmd(container.getId()).exec();
  int exitCode=dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  assertThat(exitCode,equalTo(0));
  LogContainerTestCallback loggingCallback=new LogContainerTestCallback();
  dockerClient.logContainerCmd(container.getId()).withStdErr().withStdOut().withSince(timestamp).exec(loggingCallback);
  loggingCallback.awaitCompletion();
  assertFalse(loggingCallback.toString().contains(snippet));
}
Program: 111407
Project: 111407
Buggy source:
@Test(groups="String_Node_Str") public void removeContainer() throws DockerException {
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str").exec();
  dockerClient.startContainerCmd(container.getId()).exec();
  dockerClient.waitContainerCmd(container.getId()).exec();
  LOG.info("String_Node_Str",container.getId());
  dockerClient.removeContainerCmd(container.getId()).exec();
  List<Container> containers2=dockerClient.listContainersCmd().withShowAll(true).exec();
  Matcher matcher=not(hasItem(hasField("String_Node_Str",startsWith(container.getId()))));
  assertThat(containers2,matcher);
}

Fixed version (ground truth):
@Test(groups="String_Node_Str") public void removeContainer() throws DockerException {
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withCmd("String_Node_Str").exec();
  dockerClient.startContainerCmd(container.getId()).exec();
  dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  LOG.info("String_Node_Str",container.getId());
  dockerClient.removeContainerCmd(container.getId()).exec();
  List<Container> containers2=dockerClient.listContainersCmd().withShowAll(true).exec();
  Matcher matcher=not(hasItem(hasField("String_Node_Str",startsWith(container.getId()))));
  assertThat(containers2,matcher);
}
Program: 111408
Project: 111408
Buggy source:
@Test public void startContainerWithVolumes() throws DockerException {
  Volume volume1=new Volume("String_Node_Str");
  Volume volume2=new Volume("String_Node_Str");
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withVolumes(volume1,volume2).withCmd("String_Node_Str").withBinds(new Bind("String_Node_Str",volume1,ro),new Bind("String_Node_Str",volume2)).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  InspectContainerResponse inspectContainerResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertThat(inspectContainerResponse.getConfig().getVolumes().keySet(),contains("String_Node_Str","String_Node_Str"));
  dockerClient.startContainerCmd(container.getId()).exec();
  dockerClient.waitContainerCmd(container.getId()).exec();
  inspectContainerResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertContainerHasVolumes(inspectContainerResponse,volume1,volume2);
  assertThat(Arrays.asList(inspectContainerResponse.getVolumesRW()),contains(new VolumeRW(volume1,AccessMode.ro),new VolumeRW(volume2)));
}

Fixed version (ground truth):
@Test public void startContainerWithVolumes() throws DockerException {
  Volume volume1=new Volume("String_Node_Str");
  Volume volume2=new Volume("String_Node_Str");
  CreateContainerResponse container=dockerClient.createContainerCmd("String_Node_Str").withVolumes(volume1,volume2).withCmd("String_Node_Str").withBinds(new Bind("String_Node_Str",volume1,ro),new Bind("String_Node_Str",volume2)).exec();
  LOG.info("String_Node_Str",container.toString());
  assertThat(container.getId(),not(isEmptyString()));
  InspectContainerResponse inspectContainerResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertThat(inspectContainerResponse.getConfig().getVolumes().keySet(),contains("String_Node_Str","String_Node_Str"));
  dockerClient.startContainerCmd(container.getId()).exec();
  dockerClient.waitContainerCmd(container.getId()).exec(new WaitContainerResultCallback()).awaitStatusCode();
  inspectContainerResponse=dockerClient.inspectContainerCmd(container.getId()).exec();
  assertContainerHasVolumes(inspectContainerResponse,volume1,volume2);
  assertThat(Arrays.asList(inspectContainerResponse.getVolumesRW()),contains(new VolumeRW(volume1,AccessMode.ro),new VolumeRW(volume2)));
}
Program: 111409
Project: 111409
Buggy source:
@Override public void close() throws IOException {
}

Fixed version (ground truth):
@Override public void close(){
}
Program: 111410
Project: 111410
Buggy source:
@Override public void close() throws IOException {
}

Fixed version (ground truth):
@Override public void close(){
}
Program: 111411
Project: 111411
Buggy source:
@Override public void close() throws IOException {
  super.close();
  tarInputStream.close();
}

Fixed version (ground truth):
@Override public void close(){
  super.close();
  try {
    tarInputStream.close();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 111412
Project: 111412
Buggy source:
@Override public void onComplete(){
  resultCallback.onComplete();
  try {
    command.close();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void onComplete(){
  resultCallback.onComplete();
  command.close();
}
Program: 111413
Project: 111413
Buggy source:
protected final Void execute(final CMD_T command,final ResultCallback<A_RES_T> resultCallback){
  ResultCallback<A_RES_T> delegatingResultCallback=new ResultCallback<A_RES_T>(){
    @Override public void close() throws IOException {
      resultCallback.close();
      command.close();
    }
    @Override public void onStart(    Closeable closeable){
      resultCallback.onStart(closeable);
    }
    @Override public void onNext(    A_RES_T object){
      resultCallback.onNext(object);
    }
    @Override public void onError(    Throwable throwable){
      resultCallback.onError(throwable);
    }
    @Override public void onComplete(){
      resultCallback.onComplete();
      try {
        command.close();
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
;
  AbstractCallbackNotifier<A_RES_T> callbackNotifier=callbackNotifier(command,delegatingResultCallback);
  AbstractCallbackNotifier.startAsyncProcessing(callbackNotifier);
  return null;
}

Fixed version (ground truth):
protected final Void execute(final CMD_T command,final ResultCallback<A_RES_T> resultCallback){
  ResultCallback<A_RES_T> delegatingResultCallback=new ResultCallback<A_RES_T>(){
    @Override public void close() throws IOException {
      resultCallback.close();
      command.close();
    }
    @Override public void onStart(    Closeable closeable){
      resultCallback.onStart(closeable);
    }
    @Override public void onNext(    A_RES_T object){
      resultCallback.onNext(object);
    }
    @Override public void onError(    Throwable throwable){
      resultCallback.onError(throwable);
    }
    @Override public void onComplete(){
      resultCallback.onComplete();
      command.close();
    }
  }
;
  AbstractCallbackNotifier<A_RES_T> callbackNotifier=callbackNotifier(command,delegatingResultCallback);
  AbstractCallbackNotifier.startAsyncProcessing(callbackNotifier);
  return null;
}
Program: 111414
Project: 111414
Buggy source:
@Override public RES_T exec(CMD_T command){
  RES_T result;
  try {
    result=execute(command);
  }
 catch (  ProcessingException e) {
    if (e.getCause() instanceof DockerException) {
      throw (DockerException)e.getCause();
    }
 else {
      throw e;
    }
  }
 finally {
    try {
      command.close();
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public RES_T exec(CMD_T command){
  try (CMD_T cmd=command){
    try {
      return execute(cmd);
    }
 catch (    ProcessingException e) {
      if (e.getCause() instanceof DockerException) {
        throw (DockerException)e.getCause();
      }
 else {
        throw e;
      }
    }
  }
 }
Program: 111415
Project: 111415
Buggy source:
@Override public boolean accept(File file){
  String relativePath=FilePathUtil.relativize(base,file);
  boolean match=GoLangFileMatch.match(patterns,relativePath);
  return !match;
}

Fixed version (ground truth):
@Override public boolean accept(File file){
  String relativePath=FilePathUtil.relativize(base,file);
  return GoLangFileMatch.match(patterns,relativePath).isEmpty();
}
Program: 111416
Project: 111416
Buggy source:
public ScannedResult() throws IOException {
  ignores=getIgnores();
  filesToAdd.add(dockerFile);
  for (  DockerfileStatement statement : getStatements()) {
    if (statement instanceof DockerfileStatement.Env) {
      processEnvStatement((DockerfileStatement.Env)statement);
    }
 else     if (statement instanceof DockerfileStatement.Add) {
      processAddStatement((DockerfileStatement.Add)statement);
    }
  }
}

Fixed version (ground truth):
public ScannedResult() throws IOException {
  ignores=getIgnores();
  String matchingIgnorePattern=effectiveMatchingIgnorePattern(dockerFile);
  if (matchingIgnorePattern == null) {
    filesToAdd.add(dockerFile);
  }
 else {
    throw new DockerClientException(String.format("String_Node_Str",matchingIgnorePattern));
  }
  for (  DockerfileStatement statement : getStatements()) {
    if (statement instanceof DockerfileStatement.Env) {
      processEnvStatement((DockerfileStatement.Env)statement);
    }
 else     if (statement instanceof DockerfileStatement.Add) {
      processAddStatement((DockerfileStatement.Add)statement);
    }
  }
}
Program: 111417
Project: 111417
Buggy source:
public List<String> getIgnores() throws IOException {
  List<String> ignores=new ArrayList<String>();
  File dockerIgnoreFile=new File(getDockerFolder(),"String_Node_Str");
  if (dockerIgnoreFile.exists()) {
    int lineNumber=0;
    List<String> dockerIgnoreFileContent=FileUtils.readLines(dockerIgnoreFile);
    for (    String pattern : dockerIgnoreFileContent) {
      lineNumber++;
      pattern=pattern.trim();
      if (pattern.isEmpty()) {
        continue;
      }
      pattern=FilenameUtils.normalize(pattern);
      try {
        if (GoLangFileMatch.match(pattern,"String_Node_Str")) {
          throw new DockerClientException(String.format("String_Node_Str",pattern,lineNumber));
        }
        ignores.add(pattern);
      }
 catch (      GoLangFileMatchException e) {
        throw new DockerClientException(String.format("String_Node_Str",pattern,lineNumber));
      }
    }
  }
  return ignores;
}

Fixed version (ground truth):
public List<String> getIgnores() throws IOException {
  List<String> ignores=new ArrayList<String>();
  File dockerIgnoreFile=new File(getDockerFolder(),"String_Node_Str");
  if (dockerIgnoreFile.exists()) {
    int lineNumber=0;
    List<String> dockerIgnoreFileContent=FileUtils.readLines(dockerIgnoreFile);
    for (    String pattern : dockerIgnoreFileContent) {
      lineNumber++;
      pattern=pattern.trim();
      if (pattern.isEmpty()) {
        continue;
      }
      pattern=FilenameUtils.normalize(pattern);
      try {
        ignores.add(pattern);
      }
 catch (      GoLangFileMatchException e) {
        throw new DockerClientException(String.format("String_Node_Str",pattern,lineNumber));
      }
    }
  }
  return ignores;
}
Program: 111418
Project: 111418
Buggy source:
private void processAddStatement(DockerfileStatement.Add add) throws IOException {
  add=add.transform(environmentMap);
  for (  String resource : add.getFileResources()) {
    File dockerFolder=getDockerFolder();
    File src=new File(resource);
    if (!src.isAbsolute()) {
      src=new File(dockerFolder,resource);
    }
 else {
      throw new DockerClientException(String.format("String_Node_Str",src,dockerFolder));
    }
    if (src.exists()) {
      src=src.getCanonicalFile();
      if (src.isDirectory()) {
        Collection<File> files=FileUtils.listFiles(src,new GoLangMatchFileFilter(src,ignores),TrueFileFilter.INSTANCE);
        filesToAdd.addAll(files);
      }
 else       if (!GoLangFileMatch.match(ignores,FilePathUtil.relativize(dockerFolder,src))) {
        filesToAdd.add(src);
      }
 else {
        throw new DockerClientException(String.format("String_Node_Str",src));
      }
    }
 else {
      filesToAdd.addAll(resolveWildcards(src,ignores));
    }
  }
}

Fixed version (ground truth):
private void processAddStatement(DockerfileStatement.Add add) throws IOException {
  add=add.transform(environmentMap);
  for (  String resource : add.getFileResources()) {
    File dockerFolder=getDockerFolder();
    File src=new File(resource);
    if (!src.isAbsolute()) {
      src=new File(dockerFolder,resource);
    }
 else {
      throw new DockerClientException(String.format("String_Node_Str",src,dockerFolder));
    }
    if (src.exists()) {
      src=src.getCanonicalFile();
      if (src.isDirectory()) {
        Collection<File> files=FileUtils.listFiles(src,new GoLangMatchFileFilter(src,ignores),TrueFileFilter.INSTANCE);
        filesToAdd.addAll(files);
      }
 else       if (effectiveMatchingIgnorePattern(src) == null) {
        filesToAdd.add(src);
      }
 else {
        throw new DockerClientException(String.format("String_Node_Str",src));
      }
    }
 else {
      filesToAdd.addAll(resolveWildcards(src,ignores));
    }
  }
}
Program: 111419
Project: 111419
Buggy source:
public static HostnameReposName resolveRepositoryName(String reposName){
  if (reposName.contains("String_Node_Str")) {
    throw new InvalidRepositoryNameException();
  }
  String[] nameParts=reposName.split("String_Node_Str",2);
  if (nameParts.length == 1 || (!nameParts[0].contains("String_Node_Str") && !nameParts[0].contains("String_Node_Str") && !nameParts[0].equals("String_Node_Str"))) {
    return new HostnameReposName(AuthConfig.DEFAULT_SERVER_ADDRESS,reposName);
  }
  String hostname=nameParts[0];
  reposName=nameParts[1];
  if (hostname.contains("String_Node_Str")) {
    throw new InvalidRepositoryNameException(String.format("String_Node_Str",reposName));
  }
  validateRepositoryName(reposName);
  return new HostnameReposName(hostname,reposName);
}

Fixed version (ground truth):
public static HostnameReposName resolveRepositoryName(String reposName){
  if (reposName.contains("String_Node_Str")) {
    throw new InvalidRepositoryNameException();
  }
  String[] nameParts=reposName.split("String_Node_Str",2);
  if (nameParts.length == 1 || (!nameParts[0].contains("String_Node_Str") && !nameParts[0].contains("String_Node_Str") && !nameParts[0].equals("String_Node_Str"))) {
    return new HostnameReposName(AuthConfig.DEFAULT_SERVER_ADDRESS,reposName);
  }
  String hostname=nameParts[0];
  reposName=nameParts[1];
  if (hostname.contains("String_Node_Str")) {
    throw new InvalidRepositoryNameException(String.format("String_Node_Str",reposName));
  }
  validateRepoName(reposName);
  return new HostnameReposName(hostname,reposName);
}
Program: 111420
Project: 111420
Buggy source:
@Override public boolean accept(File file){
  String relativePath=FilePathUtil.relativize(base,file);
  boolean match=GoLangFileMatch.match(patterns,relativePath);
  return !match;
}

Fixed version (ground truth):
@Override public boolean accept(File file){
  String relativePath=FilePathUtil.relativize(base,file);
  return GoLangFileMatch.match(patterns,relativePath).isEmpty();
}
Program: 111421
Project: 111421
Buggy source:
public ScannedResult() throws IOException {
  ignores=getIgnores();
  filesToAdd.add(dockerFile);
  for (  DockerfileStatement statement : getStatements()) {
    if (statement instanceof DockerfileStatement.Env) {
      processEnvStatement((DockerfileStatement.Env)statement);
    }
 else     if (statement instanceof DockerfileStatement.Add) {
      processAddStatement((DockerfileStatement.Add)statement);
    }
  }
}

Fixed version (ground truth):
public ScannedResult() throws IOException {
  ignores=getIgnores();
  String matchingIgnorePattern=effectiveMatchingIgnorePattern(dockerFile);
  if (matchingIgnorePattern == null) {
    filesToAdd.add(dockerFile);
  }
 else {
    throw new DockerClientException(String.format("String_Node_Str",matchingIgnorePattern));
  }
  for (  DockerfileStatement statement : getStatements()) {
    if (statement instanceof DockerfileStatement.Env) {
      processEnvStatement((DockerfileStatement.Env)statement);
    }
 else     if (statement instanceof DockerfileStatement.Add) {
      processAddStatement((DockerfileStatement.Add)statement);
    }
  }
}
Program: 111422
Project: 111422
Buggy source:
public List<String> getIgnores() throws IOException {
  List<String> ignores=new ArrayList<String>();
  File dockerIgnoreFile=new File(getDockerFolder(),"String_Node_Str");
  if (dockerIgnoreFile.exists()) {
    int lineNumber=0;
    List<String> dockerIgnoreFileContent=FileUtils.readLines(dockerIgnoreFile);
    for (    String pattern : dockerIgnoreFileContent) {
      lineNumber++;
      pattern=pattern.trim();
      if (pattern.isEmpty()) {
        continue;
      }
      pattern=FilenameUtils.normalize(pattern);
      try {
        if (GoLangFileMatch.match(pattern,"String_Node_Str")) {
          throw new DockerClientException(String.format("String_Node_Str",pattern,lineNumber));
        }
        ignores.add(pattern);
      }
 catch (      GoLangFileMatchException e) {
        throw new DockerClientException(String.format("String_Node_Str",pattern,lineNumber));
      }
    }
  }
  return ignores;
}

Fixed version (ground truth):
public List<String> getIgnores() throws IOException {
  List<String> ignores=new ArrayList<String>();
  File dockerIgnoreFile=new File(getDockerFolder(),"String_Node_Str");
  if (dockerIgnoreFile.exists()) {
    int lineNumber=0;
    List<String> dockerIgnoreFileContent=FileUtils.readLines(dockerIgnoreFile);
    for (    String pattern : dockerIgnoreFileContent) {
      lineNumber++;
      pattern=pattern.trim();
      if (pattern.isEmpty()) {
        continue;
      }
      pattern=FilenameUtils.normalize(pattern);
      try {
        ignores.add(pattern);
      }
 catch (      GoLangFileMatchException e) {
        throw new DockerClientException(String.format("String_Node_Str",pattern,lineNumber));
      }
    }
  }
  return ignores;
}
Program: 111423
Project: 111423
Buggy source:
private void processAddStatement(DockerfileStatement.Add add) throws IOException {
  add=add.transform(environmentMap);
  for (  String resource : add.getFileResources()) {
    File dockerFolder=getDockerFolder();
    File src=new File(resource);
    if (!src.isAbsolute()) {
      src=new File(dockerFolder,resource);
    }
 else {
      throw new DockerClientException(String.format("String_Node_Str",src,dockerFolder));
    }
    if (src.exists()) {
      src=src.getCanonicalFile();
      if (src.isDirectory()) {
        Collection<File> files=FileUtils.listFiles(src,new GoLangMatchFileFilter(src,ignores),TrueFileFilter.INSTANCE);
        filesToAdd.addAll(files);
      }
 else       if (!GoLangFileMatch.match(ignores,FilePathUtil.relativize(dockerFolder,src))) {
        filesToAdd.add(src);
      }
 else {
        throw new DockerClientException(String.format("String_Node_Str",src));
      }
    }
 else {
      filesToAdd.addAll(resolveWildcards(src,ignores));
    }
  }
}

Fixed version (ground truth):
private void processAddStatement(DockerfileStatement.Add add) throws IOException {
  add=add.transform(environmentMap);
  for (  String resource : add.getFileResources()) {
    File dockerFolder=getDockerFolder();
    File src=new File(resource);
    if (!src.isAbsolute()) {
      src=new File(dockerFolder,resource);
    }
 else {
      throw new DockerClientException(String.format("String_Node_Str",src,dockerFolder));
    }
    if (src.exists()) {
      src=src.getCanonicalFile();
      if (src.isDirectory()) {
        Collection<File> files=FileUtils.listFiles(src,new GoLangMatchFileFilter(src,ignores),TrueFileFilter.INSTANCE);
        filesToAdd.addAll(files);
      }
 else       if (effectiveMatchingIgnorePattern(src) == null) {
        filesToAdd.add(src);
      }
 else {
        throw new DockerClientException(String.format("String_Node_Str",src));
      }
    }
 else {
      filesToAdd.addAll(resolveWildcards(src,ignores));
    }
  }
}
Program: 111424
Project: 111424
Buggy source:
private String name(PushImageCmd command){
  String name=command.getName();
  AuthConfig authConfig=command.getAuthConfig();
  return name.contains("String_Node_Str") ? name : authConfig.getUsername();
}

Fixed version (ground truth):
private String name(PushImageCmd command){
  String name=command.getName();
  AuthConfig authConfig=command.getAuthConfig();
  return (name.contains("String_Node_Str") || authConfig == null) ? name : authConfig.getUsername();
}
Program: 111425
Project: 111425
Buggy source:
@Override public Void call() throws Exception {
  int numEvents=0;
  Response response=null;
  try {
    response=webTarget.request().get(Response.class);
    InputStream inputStream=new WrappedResponseInputStream(response);
    JsonParser jp=JSON_FACTORY.createParser(inputStream);
    while (jp.nextToken() != JsonToken.END_OBJECT && !jp.isClosed() && eventCallback.isReceiving()) {
      eventCallback.onEvent(OBJECT_MAPPER.readValue(jp,Event.class));
      numEvents++;
    }
  }
 catch (  Exception e) {
    eventCallback.onException(e);
  }
 finally {
    if (response != null) {
      response.close();
    }
  }
  eventCallback.onCompletion(numEvents);
  return null;
}

Fixed version (ground truth):
@Override public Void call() throws Exception {
  int numEvents=0;
  Response response=null;
  try {
    response=webTarget.request().get(Response.class);
    InputStream inputStream=new WrappedResponseInputStream(response);
    JsonParser jp=JSON_FACTORY.createParser(inputStream);
    while (jp.nextToken() != JsonToken.END_OBJECT && !jp.isClosed() && eventCallback.isReceiving()) {
      try {
        eventCallback.onEvent(OBJECT_MAPPER.readValue(jp,Event.class));
      }
 catch (      Exception e) {
        eventCallback.onException(e);
      }
      numEvents++;
    }
  }
 catch (  Exception e) {
    eventCallback.onException(e);
  }
 finally {
    if (response != null) {
      response.close();
    }
  }
  eventCallback.onCompletion(numEvents);
  return null;
}
Program: 111426
Project: 111426
Buggy source:
public int[] getOnBuild(){
  return onBuild;
}

Fixed version (ground truth):
public String[] getOnBuild(){
  return onBuild;
}
Program: 111427
Project: 111427
Buggy source:
@JsonIgnore public Volume[] getVolumesRW(){
  return volumesRW.getVolumes();
}

Fixed version (ground truth):
@JsonIgnore public VolumeRW[] getVolumesRW(){
  return volumesRW.getVolumesRW();
}
Program: 111428
Project: 111428
Buggy source:
/** 
 * Returns a string representation of this   {@link Bind} suitablefor inclusion in a JSON message. The format is <code>&lt;host path&gt;:&lt;container path&gt;:&lt;access mode&gt;</code>, like the argument in  {@link #parse(String)}.
 * @return a string representation of this {@link Bind}
 */
@Override public String toString(){
  return path + "String_Node_Str" + volume.toString()+ "String_Node_Str"+ accessMode.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of this   {@link Bind} suitablefor inclusion in a JSON message. The format is <code>&lt;host path&gt;:&lt;container path&gt;:&lt;access mode&gt;</code>, like the argument in  {@link #parse(String)}.
 * @return a string representation of this {@link Bind}
 */
@Override public String toString(){
  return path + "String_Node_Str" + volume.getPath()+ "String_Node_Str"+ accessMode.toString();
}
Program: 111429
Project: 111429
Buggy source:
/** 
 * Parses a bind mount specification to a   {@link Bind}.
 * @param serialized the specification, e.g. <code>/host:/container:ro</code>
 * @return a {@link Bind} matching the specification
 * @throws IllegalArgumentException if the specification cannot be parsed
 */
public static Bind parse(String serialized){
  try {
    String[] parts=serialized.split("String_Node_Str");
switch (parts.length) {
case 2:
{
        return new Bind(parts[0],Volume.parse(parts[1]));
      }
case 3:
{
      AccessMode accessMode=AccessMode.valueOf(parts[2].toLowerCase());
      return new Bind(parts[0],Volume.parse(parts[1]),accessMode);
    }
default :
{
    throw new IllegalArgumentException();
  }
}
}
 catch (Exception e) {
throw new IllegalArgumentException("String_Node_Str" + serialized + "String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Parses a bind mount specification to a   {@link Bind}.
 * @param serialized the specification, e.g. <code>/host:/container:ro</code>
 * @return a {@link Bind} matching the specification
 * @throws IllegalArgumentException if the specification cannot be parsed
 */
public static Bind parse(String serialized){
  try {
    String[] parts=serialized.split("String_Node_Str");
switch (parts.length) {
case 2:
{
        return new Bind(parts[0],new Volume(parts[1]));
      }
case 3:
{
      AccessMode accessMode=AccessMode.valueOf(parts[2].toLowerCase());
      return new Bind(parts[0],new Volume(parts[1]),accessMode);
    }
default :
{
    throw new IllegalArgumentException();
  }
}
}
 catch (Exception e) {
throw new IllegalArgumentException("String_Node_Str" + serialized + "String_Node_Str");
}
}
Program: 111430
Project: 111430
Buggy source:
public Volume(String path,AccessMode accessMode){
  this.path=path;
  this.accessMode=accessMode;
}

Fixed version (ground truth):
public Volume(String path){
  this.path=path;
}
Program: 111431
Project: 111431
Buggy source:
@Override public int hashCode(){
  return new HashCodeBuilder().append(path).append(accessMode).toHashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  return new HashCodeBuilder().append(path).toHashCode();
}
Program: 111432
Project: 111432
Buggy source:
@Override public boolean equals(Object obj){
  if (obj instanceof Volume) {
    Volume other=(Volume)obj;
    return new EqualsBuilder().append(path,other.getPath()).append(accessMode,other.getAccessMode()).isEquals();
  }
 else   return super.equals(obj);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj instanceof Volume) {
    Volume other=(Volume)obj;
    return new EqualsBuilder().append(path,other.getPath()).isEquals();
  }
 else   return super.equals(obj);
}
Program: 111433
Project: 111433
Buggy source:
/** 
 * Returns a string representation of this   {@link Volume} suitablefor inclusion in a JSON message. The returned String is simply the container path,  {@link #getPath()}. 
 * @return a string representation of this {@link Volume}
 */
@Override public String toString(){
  return getPath();
}

Fixed version (ground truth):
@Override public String toString(){
  return getPath();
}
Program: 111434
Project: 111434
Buggy source:
@Override public void serialize(Volumes volumes,JsonGenerator jsonGen,SerializerProvider serProvider) throws IOException, JsonProcessingException {
  jsonGen.writeStartObject();
  for (  Volume volume : volumes.getVolumes()) {
    jsonGen.writeFieldName(volume.getPath());
    jsonGen.writeString(Boolean.toString(volume.getAccessMode().equals(AccessMode.rw) ? true : false));
  }
  jsonGen.writeEndObject();
}

Fixed version (ground truth):
@Override public void serialize(Volumes volumes,JsonGenerator jsonGen,SerializerProvider serProvider) throws IOException, JsonProcessingException {
  jsonGen.writeStartObject();
  for (  Volume volume : volumes.getVolumes()) {
    jsonGen.writeFieldName(volume.getPath());
    jsonGen.writeStartObject();
    jsonGen.writeEndObject();
  }
  jsonGen.writeEndObject();
}
Program: 111435
Project: 111435
Buggy source:
@Override public Volumes deserialize(JsonParser jsonParser,DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
  List<Volume> volumes=new ArrayList<Volume>();
  ObjectCodec oc=jsonParser.getCodec();
  JsonNode node=oc.readTree(jsonParser);
  for (Iterator<Map.Entry<String,JsonNode>> it=node.fields(); it.hasNext(); ) {
    Map.Entry<String,JsonNode> field=it.next();
    if (!field.getValue().equals(NullNode.getInstance())) {
      Volume volume=Volume.parse(field.getKey());
      volumes.add(volume);
    }
  }
  return new Volumes(volumes.toArray(new Volume[0]));
}

Fixed version (ground truth):
@Override public Volumes deserialize(JsonParser jsonParser,DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
  List<Volume> volumes=new ArrayList<Volume>();
  ObjectCodec oc=jsonParser.getCodec();
  JsonNode node=oc.readTree(jsonParser);
  for (Iterator<Map.Entry<String,JsonNode>> it=node.fields(); it.hasNext(); ) {
    Map.Entry<String,JsonNode> field=it.next();
    if (!field.getValue().equals(NullNode.getInstance())) {
      String path=field.getKey();
      Volume volume=new Volume(path);
      volumes.add(volume);
    }
  }
  return new Volumes(volumes.toArray(new Volume[0]));
}
Program: 111436
Project: 111436
Buggy source:
/** 
 * @return A frame, or null if no more frames.
 */
public Frame readFrame() throws IOException {
  byte[] header=new byte[HEADER_SIZE];
  int headerSize=inputStream.read(header);
  if (headerSize == -1) {
    return null;
  }
  if (headerSize != HEADER_SIZE) {
    throw new IOException(String.format("String_Node_Str",HEADER_SIZE,headerSize));
  }
  int frameSize=(header[4] << 24) + (header[5] << 16) + (header[6] << 8)+ header[7];
  int payloadSize=frameSize - header.length;
  byte[] payload=new byte[payloadSize];
  int actualPayloadSize=inputStream.read(payload);
  if (actualPayloadSize != payloadSize) {
    throw new IOException(String.format("String_Node_Str",payloadSize,actualPayloadSize));
  }
  return new Frame(streamType(header[0]),payload);
}

Fixed version (ground truth):
/** 
 * @return A frame, or null if no more frames.
 */
public Frame readFrame() throws IOException {
  byte[] header=new byte[HEADER_SIZE];
  int headerSize=inputStream.read(header);
  if (headerSize == -1) {
    return null;
  }
  if (headerSize != HEADER_SIZE) {
    throw new IOException(String.format("String_Node_Str",HEADER_SIZE,headerSize));
  }
  int payloadSize=((header[4] & 0xff) << 24) + ((header[5] & 0xff) << 16) + ((header[6] & 0xff) << 8)+ (header[7] & 0xff);
  byte[] payload=new byte[payloadSize];
  int actualPayloadSize=inputStream.read(payload);
  if (actualPayloadSize != payloadSize) {
    throw new IOException(String.format("String_Node_Str",payloadSize,actualPayloadSize));
  }
  return new Frame(streamType(header[0]),payload);
}
Program: 111437
Project: 111437
Buggy source:
public static DockerCmdExecFactory getDefaultDockerCmdExecFactory(){
  if (!serviceLoader.iterator().hasNext()) {
    throw new RuntimeException("String_Node_Str" + DockerCmdExecFactory.class.getName() + "String_Node_Str");
  }
  return serviceLoader.iterator().next();
}

Fixed version (ground truth):
public static DockerCmdExecFactory getDefaultDockerCmdExecFactory(){
  serviceLoader.reload();
  if (!serviceLoader.iterator().hasNext()) {
    throw new RuntimeException("String_Node_Str" + DockerCmdExecFactory.class.getName() + "String_Node_Str");
  }
  return serviceLoader.iterator().next();
}