nus-yam/ex-repair huggingface dataset:
Program: 7010
Project: 7010
Buggy source:
public List<FileInfo> loadFiles(Collection<FileInfo> filesToLoad,boolean shouldReset){
  List<FileInfo> loaded=new LinkedList<FileInfo>();
  for (  FileInfo info : filesToLoad) {
    CommandTaskTest.assertTrue("String_Node_Str" + info + "String_Node_Str"+ expected.keySet(),expected.containsKey(info));
    loaded.add(new FileInfo(info.getFilePath(),info.getTimestamp(),info.isPatch(),info.isServeOnly(),expected.get(info)));
  }
  return loaded;
}

Fixed version (ground truth):
public List<FileInfo> loadFiles(Collection<FileInfo> filesToLoad,boolean shouldReset){
  List<FileInfo> loaded=new LinkedList<FileInfo>();
  for (  FileInfo info : filesToLoad) {
    CommandTaskTest.assertTrue("String_Node_Str" + info + "String_Node_Str"+ expected.keySet(),expected.containsKey(info));
    loaded.add(new FileInfo(info.getFilePath(),info.getTimestamp(),-1,info.isPatch(),info.isServeOnly(),expected.get(info)));
  }
  return loaded;
}
Program: 7011
Project: 7011
Buggy source:
public void testLoadFilesWithPostProcessor() throws Exception {
  final FileInfo info=new FileInfo("String_Node_Str",1234,false,true,null);
  final String infoData="String_Node_Str";
  final boolean shouldReset=false;
  final FileInfo expected=new FileInfo("String_Node_Str",4321,false,true,null);
  FileLoadPostProcessor processor=new FileLoadPostProcessor(){
    public FileInfo process(    FileInfo file){
      assertEquals(infoData,file.getData());
      assertEquals(info.getFilePath(),file.getFilePath());
      assertEquals(info.getTimestamp(),file.getTimestamp());
      assertEquals(info.isServeOnly(),file.isServeOnly());
      return expected;
    }
  }
;
  List<FileInfo> actual=new ProcessingFileLoader(new FileReaderStub(infoData,info),Collections.singleton(processor),new File("String_Node_Str"),new com.google.jstestdriver.util.NullStopWatch()).loadFiles(Collections.singleton(info),shouldReset);
  assertEquals(expected,actual.get(0));
}

Fixed version (ground truth):
public void testLoadFilesWithPostProcessor() throws Exception {
  final FileInfo info=new FileInfo("String_Node_Str",1234,-1,false,true,null);
  final String infoData="String_Node_Str";
  final boolean shouldReset=false;
  final FileInfo expected=new FileInfo("String_Node_Str",4321,-1,false,true,null);
  FileLoadPostProcessor processor=new FileLoadPostProcessor(){
    public FileInfo process(    FileInfo file){
      assertEquals(infoData,file.getData());
      assertEquals(info.getFilePath(),file.getFilePath());
      assertEquals(info.getTimestamp(),file.getTimestamp());
      assertEquals(info.isServeOnly(),file.isServeOnly());
      return expected;
    }
  }
;
  List<FileInfo> actual=new ProcessingFileLoader(new FileReaderStub(infoData,info),Collections.singleton(processor),new File("String_Node_Str"),new com.google.jstestdriver.util.NullStopWatch()).loadFiles(Collections.singleton(info),shouldReset);
  assertEquals(expected,actual.get(0));
}
Program: 7012
Project: 7012
Buggy source:
public void testRemoteLoadFiles() throws Exception {
  final FileInfo info=new FileInfo("String_Node_Str",-1,false,false,"String_Node_Str");
  final boolean shouldReset=false;
  List<FileInfo> actual=new ProcessingFileLoader(null,Collections.<FileLoadPostProcessor>emptySet(),new File("String_Node_Str"),new com.google.jstestdriver.util.NullStopWatch()).loadFiles(Collections.singleton(info),shouldReset);
  assertEquals("String_Node_Str",actual.get(0).getData());
  assertEquals(info.getFilePath(),actual.get(0).getFilePath());
  assertEquals(info.getTimestamp(),actual.get(0).getTimestamp());
  assertEquals(info.isServeOnly(),actual.get(0).isServeOnly());
}

Fixed version (ground truth):
public void testRemoteLoadFiles() throws Exception {
  final FileInfo info=new FileInfo("String_Node_Str",-1,-1,false,false,"String_Node_Str");
  final boolean shouldReset=false;
  List<FileInfo> actual=new ProcessingFileLoader(null,Collections.<FileLoadPostProcessor>emptySet(),new File("String_Node_Str"),new com.google.jstestdriver.util.NullStopWatch()).loadFiles(Collections.singleton(info),shouldReset);
  assertEquals("String_Node_Str",actual.get(0).getData());
  assertEquals(info.getFilePath(),actual.get(0).getFilePath());
  assertEquals(info.getTimestamp(),actual.get(0).getTimestamp());
  assertEquals(info.isServeOnly(),actual.get(0).isServeOnly());
}
Program: 7013
Project: 7013
Buggy source:
public void testLoadFiles() throws Exception {
  final FileInfo info=new FileInfo("String_Node_Str",1234,false,true,null);
  final String infoData="String_Node_Str";
  final boolean shouldReset=false;
  List<FileInfo> actual=new ProcessingFileLoader(new FileReader(){
    public String readFile(    String file){
      assertEquals(info.getAbsoluteFileName(new File("String_Node_Str")),file);
      return infoData;
    }
  }
,Collections.<FileLoadPostProcessor>emptySet(),new File("String_Node_Str"),new com.google.jstestdriver.util.NullStopWatch()).loadFiles(Collections.singleton(info),shouldReset);
  assertEquals(infoData,actual.get(0).getData());
  assertEquals(info.getFilePath(),actual.get(0).getFilePath());
  assertEquals(info.getTimestamp(),actual.get(0).getTimestamp());
  assertEquals(info.isServeOnly(),actual.get(0).isServeOnly());
}

Fixed version (ground truth):
public void testLoadFiles() throws Exception {
  final FileInfo info=new FileInfo("String_Node_Str",1234,-1,false,true,null);
  final String infoData="String_Node_Str";
  final boolean shouldReset=false;
  List<FileInfo> actual=new ProcessingFileLoader(new FileReader(){
    public String readFile(    String file){
      assertEquals(info.getAbsoluteFileName(new File("String_Node_Str")),file);
      return infoData;
    }
  }
,Collections.<FileLoadPostProcessor>emptySet(),new File("String_Node_Str"),new com.google.jstestdriver.util.NullStopWatch()).loadFiles(Collections.singleton(info),shouldReset);
  assertEquals(infoData,actual.get(0).getData());
  assertEquals(info.getFilePath(),actual.get(0).getFilePath());
  assertEquals(info.getTimestamp(),actual.get(0).getTimestamp());
  assertEquals(info.isServeOnly(),actual.get(0).isServeOnly());
}
Program: 7014
Project: 7014
Buggy source:
public void testLoadFileWithPatches() throws Exception {
  final FileInfo info=new FileInfo("String_Node_Str",1234,false,true,null);
  FileInfo patch=new FileInfo("String_Node_Str",1234,false,true,null);
  info.addPatch(patch);
  final String infoData="String_Node_Str";
  final String patchData="String_Node_Str";
  final boolean shouldReset=false;
  MockFileReader mockFileReader=new MockFileReader();
  mockFileReader.expected(info.getAbsoluteFileName(new File("String_Node_Str")),infoData).expected(patch.getAbsoluteFileName(new File("String_Node_Str")),patchData);
  List<FileInfo> actual=new ProcessingFileLoader(mockFileReader,Collections.<FileLoadPostProcessor>emptySet(),new File("String_Node_Str"),new com.google.jstestdriver.util.NullStopWatch()).loadFiles(Collections.singleton(info),shouldReset);
  assertEquals(infoData + patchData,actual.get(0).getData());
  assertEquals(info.getFilePath(),actual.get(0).getFilePath());
  assertEquals(info.getTimestamp(),actual.get(0).getTimestamp());
  assertEquals(info.isServeOnly(),actual.get(0).isServeOnly());
}

Fixed version (ground truth):
public void testLoadFileWithPatches() throws Exception {
  final FileInfo info=new FileInfo("String_Node_Str",1234,-1,false,true,null);
  FileInfo patch=new FileInfo("String_Node_Str",1234,-1,false,true,null);
  info.addPatch(patch);
  final String infoData="String_Node_Str";
  final String patchData="String_Node_Str";
  final boolean shouldReset=false;
  MockFileReader mockFileReader=new MockFileReader();
  mockFileReader.expected(info.getAbsoluteFileName(new File("String_Node_Str")),infoData).expected(patch.getAbsoluteFileName(new File("String_Node_Str")),patchData);
  List<FileInfo> actual=new ProcessingFileLoader(mockFileReader,Collections.<FileLoadPostProcessor>emptySet(),new File("String_Node_Str"),new com.google.jstestdriver.util.NullStopWatch()).loadFiles(Collections.singleton(info),shouldReset);
  assertEquals(infoData + patchData,actual.get(0).getData());
  assertEquals(info.getFilePath(),actual.get(0).getFilePath());
  assertEquals(info.getTimestamp(),actual.get(0).getTimestamp());
  assertEquals(info.isServeOnly(),actual.get(0).isServeOnly());
}
Program: 7015
Project: 7015
Buggy source:
public void testConvertRelativePathFromBaseDir() throws Exception {
  String baseDir="String_Node_Str";
  List<FileInfo> files=Lists.newLinkedList();
  files.add(new FileInfo("String_Node_Str",-1,false,false,null));
  files.add(new FileInfo("String_Node_Str",-1,false,false,null));
  files.add(new FileInfo("String_Node_Str",-1,false,false,null));
  files.add(new FileInfo("String_Node_Str",-1,false,false,null));
  RelativePathConverter relativePathConverter=new RelativePathConverter(baseDir,files);
  List<FileInfo> relativePaths=relativePathConverter.convert();
  assertEquals(4,relativePaths.size());
  assertEquals("String_Node_Str",relativePaths.get(0).getFilePath());
  assertEquals("String_Node_Str",relativePaths.get(1).getFilePath());
  assertEquals("String_Node_Str",relativePaths.get(2).getFilePath());
  assertEquals("String_Node_Str",relativePaths.get(3).getFilePath());
}

Fixed version (ground truth):
public void testConvertRelativePathFromBaseDir() throws Exception {
  String baseDir="String_Node_Str";
  List<FileInfo> files=Lists.newLinkedList();
  files.add(new FileInfo("String_Node_Str",-1,-1,false,false,null));
  files.add(new FileInfo("String_Node_Str",-1,-1,false,false,null));
  files.add(new FileInfo("String_Node_Str",-1,-1,false,false,null));
  files.add(new FileInfo("String_Node_Str",-1,-1,false,false,null));
  RelativePathConverter relativePathConverter=new RelativePathConverter(baseDir,files);
  List<FileInfo> relativePaths=relativePathConverter.convert();
  assertEquals(4,relativePaths.size());
  assertEquals("String_Node_Str",relativePaths.get(0).getFilePath());
  assertEquals("String_Node_Str",relativePaths.get(1).getFilePath());
  assertEquals("String_Node_Str",relativePaths.get(2).getFilePath());
  assertEquals("String_Node_Str",relativePaths.get(3).getFilePath());
}
Program: 7016
Project: 7016
Buggy source:
public Set<FileInfo> process(Set<FileInfo> files){
  Set<FileInfo> processed=Sets.newHashSet();
  for (  FileInfo fileInfo : files) {
    processed.add(new FileInfo(fileInfo.getFilePath(),code.lastModified(),false,true,null));
  }
  return processed;
}

Fixed version (ground truth):
public Set<FileInfo> process(Set<FileInfo> files){
  Set<FileInfo> processed=Sets.newHashSet();
  for (  FileInfo fileInfo : files) {
    processed.add(new FileInfo(fileInfo.getFilePath(),code.lastModified(),-1,false,true,null));
  }
  return processed;
}
Program: 7017
Project: 7017
Buggy source:
public void testParseConfigFileAndProcessAListOfFiles() throws Exception {
  File codeDir=createTmpSubDir("String_Node_Str");
  final String fileName="String_Node_Str";
  final File code=createTmpFile(codeDir,fileName);
  String configFile="String_Node_Str";
  ByteArrayInputStream bais=new ByteArrayInputStream(configFile.getBytes());
  YamlParser parser=new YamlParser();
  Configuration config=parser.parse(new InputStreamReader(bais)).resolvePaths(new PathResolver(tmpDir,Sets.<FileParsePostProcessor>newHashSet(new FileParsePostProcessor(){
    public Set<FileInfo> process(    Set<FileInfo> files){
      Set<FileInfo> processed=Sets.newHashSet();
      for (      FileInfo fileInfo : files) {
        processed.add(new FileInfo(fileInfo.getFilePath(),code.lastModified(),false,true,null));
      }
      return processed;
    }
  }
)),createFlags());
  Set<FileInfo> files=config.getFilesList();
  List<FileInfo> listFiles=new ArrayList<FileInfo>(files);
  assertEquals(1,files.size());
  assertTrue(listFiles.get(0).getFilePath().endsWith("String_Node_Str"));
  assertTrue(listFiles.get(0).isServeOnly());
}

Fixed version (ground truth):
public void testParseConfigFileAndProcessAListOfFiles() throws Exception {
  File codeDir=createTmpSubDir("String_Node_Str");
  final String fileName="String_Node_Str";
  final File code=createTmpFile(codeDir,fileName);
  String configFile="String_Node_Str";
  ByteArrayInputStream bais=new ByteArrayInputStream(configFile.getBytes());
  YamlParser parser=new YamlParser();
  Configuration config=parser.parse(new InputStreamReader(bais)).resolvePaths(new PathResolver(tmpDir,Sets.<FileParsePostProcessor>newHashSet(new FileParsePostProcessor(){
    public Set<FileInfo> process(    Set<FileInfo> files){
      Set<FileInfo> processed=Sets.newHashSet();
      for (      FileInfo fileInfo : files) {
        processed.add(new FileInfo(fileInfo.getFilePath(),code.lastModified(),-1,false,true,null));
      }
      return processed;
    }
  }
)),createFlags());
  Set<FileInfo> files=config.getFilesList();
  List<FileInfo> listFiles=new ArrayList<FileInfo>(files);
  assertEquals(1,files.size());
  assertTrue(listFiles.get(0).getFilePath().endsWith("String_Node_Str"));
  assertTrue(listFiles.get(0).isServeOnly());
}
Program: 7018
Project: 7018
Buggy source:
public void testSkipInstrument() throws Exception {
  FileInfo lcov=new FileInfo("String_Node_Str",0,true,false,"String_Node_Str");
  FileInfo serveOnly=new FileInfo("String_Node_Str",0,true,true,"String_Node_Str");
  FileInfo excluded=new FileInfo("String_Node_Str",0,true,false,"String_Node_Str");
  FileInfo remote=new FileInfo("String_Node_Str",0,true,false,null);
  CoverageInstrumentingProcessor processor=new CoverageInstrumentingProcessor(null,Sets.<String>newHashSet(excluded.getFilePath()),null);
  assertSame(lcov,processor.process(lcov));
  assertSame(serveOnly,processor.process(serveOnly));
  assertSame(remote,processor.process(remote));
  assertSame(excluded,processor.process(excluded));
}

Fixed version (ground truth):
public void testSkipInstrument() throws Exception {
  FileInfo lcov=new FileInfo("String_Node_Str",0,-1,true,false,"String_Node_Str");
  FileInfo serveOnly=new FileInfo("String_Node_Str",0,-1,true,true,"String_Node_Str");
  FileInfo excluded=new FileInfo("String_Node_Str",0,-1,true,false,"String_Node_Str");
  FileInfo remote=new FileInfo("String_Node_Str",0,-1,true,false,null);
  CoverageInstrumentingProcessor processor=new CoverageInstrumentingProcessor(null,Sets.<String>newHashSet(excluded.getFilePath()),null);
  assertSame(lcov,processor.process(lcov));
  assertSame(serveOnly,processor.process(serveOnly));
  assertSame(remote,processor.process(remote));
  assertSame(excluded,processor.process(excluded));
}
Program: 7019
Project: 7019
Buggy source:
public void testInstrument() throws Exception {
  FileInfo fileInfo=new FileInfo("String_Node_Str",0,true,false,"String_Node_Str");
  String expected="String_Node_Str";
  Code code=new Code(fileInfo.getFilePath(),fileInfo.getData());
  CoverageAccumulator accumulator=new CoverageAccumulator();
  FileInfo decorated=new CoverageInstrumentingProcessor(new DecoratorStub(expected,code),Collections.<String>emptySet(),accumulator).process(fileInfo);
  assertEquals(expected,decorated.getData());
  assertEquals(fileInfo.getFilePath(),decorated.getFilePath());
  assertEquals(fileInfo.getTimestamp(),decorated.getTimestamp());
  assertEquals(fileInfo.isServeOnly(),decorated.isServeOnly());
}

Fixed version (ground truth):
public void testInstrument() throws Exception {
  FileInfo fileInfo=new FileInfo("String_Node_Str",0,-1,true,false,"String_Node_Str");
  String expected="String_Node_Str";
  Code code=new Code(fileInfo.getFilePath(),fileInfo.getData());
  CoverageAccumulator accumulator=new CoverageAccumulator();
  FileInfo decorated=new CoverageInstrumentingProcessor(new DecoratorStub(expected,code),Collections.<String>emptySet(),accumulator).process(fileInfo);
  assertEquals(expected,decorated.getData());
  assertEquals(fileInfo.getFilePath(),decorated.getFilePath());
  assertEquals(fileInfo.getTimestamp(),decorated.getTimestamp());
  assertEquals(fileInfo.isServeOnly(),decorated.isServeOnly());
}
Program: 7020
Project: 7020
Buggy source:
public void testAddJs() throws Exception {
  LinkedList<FileInfo> files=new LinkedList<FileInfo>();
  String lcovSource="String_Node_Str";
  List<FileInfo> processed=new CoverageJsAdder(new FileLoaderStub(lcovSource)).processDependencies(files);
  FileInfo lcov=processed.get(0);
  assertEquals(new LoadedFileInfo(CoverageJsAdder.LCOV_JS,-1,false,false,lcovSource),lcov);
  assertEquals(lcovSource,lcov.getData());
  assertFalse(lcov.canLoad());
}

Fixed version (ground truth):
public void testAddJs() throws Exception {
  LinkedList<FileInfo> files=new LinkedList<FileInfo>();
  String lcovSource="String_Node_Str";
  List<FileInfo> processed=new CoverageJsAdder(new FileLoaderStub(lcovSource)).processPlugins(files);
  FileInfo lcov=processed.get(0);
  assertEquals(new LoadedFileInfo(CoverageJsAdder.LCOV_JS,-1,false,false,lcovSource),lcov);
  assertEquals(lcovSource,lcov.getData());
  assertFalse(lcov.canLoad());
}
Program: 7021
Project: 7021
Buggy source:
public void testAddJsWithExistingFiles() throws Exception {
  LinkedList<FileInfo> files=new LinkedList<FileInfo>();
  FileInfo expected=new FileInfo("String_Node_Str",1,false,false,null);
  files.add(expected);
  String lcovSource="String_Node_Str";
  List<FileInfo> processed=new CoverageJsAdder(new FileLoaderStub(lcovSource)).processDependencies(files);
  FileInfo lcov=processed.get(0);
  assertEquals(new LoadedFileInfo(CoverageJsAdder.LCOV_JS,-1,false,false,lcovSource),lcov);
  assertEquals(lcovSource,lcov.getData());
  assertFalse(lcov.canLoad());
  assertSame(expected,processed.get(1));
}

Fixed version (ground truth):
public void testAddJsWithExistingFiles() throws Exception {
  LinkedList<FileInfo> files=new LinkedList<FileInfo>();
  FileInfo expected=new FileInfo("String_Node_Str",1,-1,false,false,null);
  files.add(expected);
  String lcovSource="String_Node_Str";
  List<FileInfo> processed=new CoverageJsAdder(new FileLoaderStub(lcovSource)).processPlugins(files);
  FileInfo lcov=processed.get(0);
  assertEquals(new LoadedFileInfo(CoverageJsAdder.LCOV_JS,-1,false,false,lcovSource),lcov);
  assertEquals(lcovSource,lcov.getData());
  assertFalse(lcov.canLoad());
  assertSame(expected,processed.get(1));
}
Program: 7022
Project: 7022
Buggy source:
private void doScriptTest(ScriptBuilder script){
  FileInfo test=new FileInfo("String_Node_Str",20,false,false,script.buildTest());
  FileInfo expected=new FileInfo(test.getFilePath(),test.getTimestamp(),test.isPatch(),test.isServeOnly(),script.buildExpect());
  FileInfo actual=new InlineHtmlProcessor(new HtmlDocParser(),new HtmlDocLexer()).process(test);
  assertEquals(expected.getFilePath(),actual.getFilePath());
  assertEquals(expected.getTimestamp(),actual.getTimestamp());
  assertEquals(expected.isPatch(),actual.isPatch());
  assertEquals(expected.isServeOnly(),actual.isServeOnly());
  assertEquals(expected.getData(),actual.getData());
}

Fixed version (ground truth):
private void doScriptTest(ScriptBuilder script){
  FileInfo test=new FileInfo("String_Node_Str",20,-1,false,false,script.buildTest());
  FileInfo expected=new FileInfo(test.getFilePath(),test.getTimestamp(),-1,test.isPatch(),test.isServeOnly(),script.buildExpect());
  FileInfo actual=new InlineHtmlProcessor(new HtmlDocParser(),new HtmlDocLexer()).process(test);
  assertEquals(expected.getFilePath(),actual.getFilePath());
  assertEquals(expected.getTimestamp(),actual.getTimestamp());
  assertEquals(expected.isPatch(),actual.isPatch());
  assertEquals(expected.isServeOnly(),actual.isServeOnly());
  assertEquals(expected.getData(),actual.getData());
}
Program: 7023
Project: 7023
Buggy source:
public void testCreateWithTests() throws Exception {
  List<FileInfo> files=Lists.newArrayList();
  FileInfo one=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo two=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo three=new FileInfo("String_Node_Str",1234,false,false,null);
  files.add(one);
  files.add(two);
  files.add(three);
  FileInfo testOne=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo testTwo=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo testThree=new FileInfo("String_Node_Str",1234,false,false,null);
  List<FileInfo> tests=Lists.newArrayList(testOne,testTwo,testThree);
  final JstdTestCaseFactory testCaseFactory=new JstdTestCaseFactory(Collections.<JstdTestCaseProcessor>emptySet(),Collections.<ResourceDependencyResolver>emptySet());
  List<JstdTestCase> testCases=testCaseFactory.createCases(Collections.<FileInfo>emptyList(),files,tests);
  assertEquals(1,testCases.size());
  JstdTestCase jstdTestCase=testCases.get(0);
  assertEquals(tests,jstdTestCase.getTests());
  assertEquals(Lists.newArrayList(files),jstdTestCase.getDependencies());
}

Fixed version (ground truth):
public void testCreateWithTests() throws Exception {
  List<FileInfo> files=Lists.newArrayList();
  FileInfo one=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo two=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo three=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  files.add(one);
  files.add(two);
  files.add(three);
  FileInfo testOne=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo testTwo=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo testThree=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  List<FileInfo> tests=Lists.newArrayList(testOne,testTwo,testThree);
  final JstdTestCaseFactory testCaseFactory=new JstdTestCaseFactory(Collections.<JstdTestCaseProcessor>emptySet(),Collections.<ResourceDependencyResolver>emptySet());
  List<JstdTestCase> testCases=testCaseFactory.createCases(Collections.<FileInfo>emptyList(),files,tests);
  assertEquals(1,testCases.size());
  JstdTestCase jstdTestCase=testCases.get(0);
  assertEquals(tests,jstdTestCase.getTests());
  assertEquals(Lists.newArrayList(files),jstdTestCase.getDependencies());
}
Program: 7024
Project: 7024
Buggy source:
public void testCreateWithOutTests() throws Exception {
  List<FileInfo> fileSet=Lists.newArrayList();
  FileInfo one=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo two=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo three=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo testOne=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo testTwo=new FileInfo("String_Node_Str",1234,false,false,null);
  FileInfo testThree=new FileInfo("String_Node_Str",1234,false,false,null);
  fileSet.add(one);
  fileSet.add(two);
  fileSet.add(three);
  fileSet.add(testOne);
  fileSet.add(testTwo);
  fileSet.add(testThree);
  final JstdTestCaseFactory testCaseFactory=new JstdTestCaseFactory(Collections.<JstdTestCaseProcessor>emptySet(),Collections.<ResourceDependencyResolver>emptySet());
  List<JstdTestCase> testCases=testCaseFactory.createCases(Collections.<FileInfo>emptyList(),fileSet,Lists.<FileInfo>newArrayList());
  assertEquals(1,testCases.size());
  JstdTestCase jstdTestCase=testCases.get(0);
  assertTrue(jstdTestCase.getTests().isEmpty());
  assertEquals(Lists.newArrayList(fileSet),jstdTestCase.getDependencies());
}

Fixed version (ground truth):
public void testCreateWithOutTests() throws Exception {
  List<FileInfo> fileSet=Lists.newArrayList();
  FileInfo one=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo two=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo three=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo testOne=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo testTwo=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  FileInfo testThree=new FileInfo("String_Node_Str",1234,-1,false,false,null);
  fileSet.add(one);
  fileSet.add(two);
  fileSet.add(three);
  fileSet.add(testOne);
  fileSet.add(testTwo);
  fileSet.add(testThree);
  final JstdTestCaseFactory testCaseFactory=new JstdTestCaseFactory(Collections.<JstdTestCaseProcessor>emptySet(),Collections.<ResourceDependencyResolver>emptySet());
  List<JstdTestCase> testCases=testCaseFactory.createCases(Collections.<FileInfo>emptyList(),fileSet,Lists.<FileInfo>newArrayList());
  assertEquals(1,testCases.size());
  JstdTestCase jstdTestCase=testCases.get(0);
  assertTrue(jstdTestCase.getTests().isEmpty());
  assertEquals(Lists.newArrayList(fileSet),jstdTestCase.getDependencies());
}
Program: 7026
Project: 7026
Buggy source:
public void testFileCache() throws IOException, ServletException {
  HttpServletRequest request=EasyMock.createMock(HttpServletRequest.class);
  HttpServletResponse response=EasyMock.createMock(HttpServletResponse.class);
  FileCacheHandler handler=new FileCacheHandler(request,response);
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  PrintWriter writer=new PrintWriter(out);
  FileInfo info=new FileInfo("String_Node_Str",1,false,true,"String_Node_Str");
  EasyMock.expect(request.getParameter("String_Node_Str")).andReturn(gson.toJson(new FileInfo[]{info}));
  EasyMock.expect(response.getWriter()).andReturn(writer);
  EasyMock.replay(request,response);
  handler.handleIt();
  writer.flush();
  Collection<FileInfo> infos=gson.fromJson(out.toString(),new TypeToken<Collection<FileInfo>>(){
  }
.getType());
  assertEquals(info,infos.iterator().next());
  EasyMock.verify(request,response);
}

Fixed version (ground truth):
public void testFileCache() throws IOException, ServletException {
  HttpServletRequest request=EasyMock.createMock(HttpServletRequest.class);
  HttpServletResponse response=EasyMock.createMock(HttpServletResponse.class);
  FileCacheHandler handler=new FileCacheHandler(request,response,new Gson(),new HashSet<FileInfo>(),new FileSetCacheStrategy());
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  PrintWriter writer=new PrintWriter(out);
  FileInfo info=new FileInfo("String_Node_Str",1,false,true,"String_Node_Str");
  EasyMock.expect(request.getParameter("String_Node_Str")).andReturn(gson.toJson(new FileInfo[]{info}));
  EasyMock.expect(response.getWriter()).andReturn(writer);
  EasyMock.replay(request,response);
  handler.handleIt();
  writer.flush();
  Collection<FileInfo> infos=gson.fromJson(out.toString(),new TypeToken<Collection<FileInfo>>(){
  }
.getType());
  assertEquals(info,infos.iterator().next());
  EasyMock.verify(request,response);
}
Program: 7027
Project: 7027
Buggy source:
@Inject public FileCacheHandler(HttpServletRequest request,HttpServletResponse response){
  this.request=request;
  this.response=response;
}

Fixed version (ground truth):
@Inject public FileCacheHandler(HttpServletRequest request,HttpServletResponse response,Gson gson,Set<FileInfo> currentFiles,FileSetCacheStrategy strategy){
  this.request=request;
  this.response=response;
  this.gson=gson;
  this.currentFiles=currentFiles;
  this.strategy=strategy;
}
Program: 7029
Project: 7029
Buggy source:
public void removeSlave(String id){
  slaves.remove(id);
}

Fixed version (ground truth):
public void removeSlave(String id){
  SlaveBrowser slave=slaves.remove(id);
  setChanged();
  notifyObservers(new BrowserCaptureEvent(Event.DISCONNECTED,slave));
}
Program: 7030
Project: 7030
Buggy source:
public void addSlave(SlaveBrowser slave){
  slaves.put(slave.getId(),slave);
  setChanged();
  notifyObservers(slave);
}

Fixed version (ground truth):
public void addSlave(SlaveBrowser slave){
  slaves.put(slave.getId(),slave);
  setChanged();
  notifyObservers(new BrowserCaptureEvent(Event.CONNECTED,slave));
}
Program: 7031
Project: 7031
Buggy source:
public void update(Observable o,Object arg){
  SlaveBrowser browser=(SlaveBrowser)arg;
  locks.put(browser.getId(),new Lock());
}

Fixed version (ground truth):
public void update(Observable o,Object arg){
  BrowserCaptureEvent captureEvent=(BrowserCaptureEvent)arg;
  if (captureEvent.event == Event.CONNECTED) {
    locks.put(captureEvent.getBrowser().getId(),new Lock());
  }
}
Program: 7032
Project: 7032
Buggy source:
public static void main(String[] args) throws IOException {
  String serverURL=args[0];
  String settingsFile=args[1];
  int port=Integer.parseInt(args[2]);
  Socket socket=new Socket();
  int retries=RETRIES;
  do {
    try {
      socket.connect(new InetSocketAddress(InetAddress.getLocalHost(),port),TIMEOUT_MILLIS);
      break;
    }
 catch (    ConnectException e) {
      retries--;
    }
  }
 while (retries > 0);
  new TestRunner(serverURL,settingsFile,new File("String_Node_Str"),new ObjectOutputStream(socket.getOutputStream())).execute();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  String serverURL=args[0];
  String settingsFile=args[1];
  int port=Integer.parseInt(args[2]);
  Socket socket=new Socket();
  int retries=RETRIES;
  do {
    try {
      socket.connect(new InetSocketAddress(InetAddress.getLocalHost(),port),TIMEOUT_MILLIS);
      break;
    }
 catch (    SocketException e) {
      retries--;
    }
  }
 while (retries > 0);
  new TestRunner(serverURL,settingsFile,new File("String_Node_Str"),new ObjectOutputStream(socket.getOutputStream())).execute();
}
Program: 7033
Project: 7033
Buggy source:
public void update(Observable observable,Object o){
  SlaveBrowser slave=(SlaveBrowser)o;
  if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    firefoxLabel.setIcon(firefox.getColorIcon());
  }
 else   if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    chromeLabel.setIcon(chrome.getColorIcon());
  }
 else   if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    operaLabel.setIcon(opera.getColorIcon());
  }
 else   if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    safariLabel.setIcon(safari.getColorIcon());
  }
 else   if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    ieLabel.setIcon(ie.getColorIcon());
  }
}

Fixed version (ground truth):
public void update(Observable observable,Object o){
  BrowserCaptureEvent captureEvent=(BrowserCaptureEvent)o;
  SlaveBrowser slave=captureEvent.getBrowser();
  if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    firefoxLabel.setIcon(firefox.getIconForEvent(captureEvent.event));
  }
 else   if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    chromeLabel.setIcon(chrome.getIconForEvent(captureEvent.event));
  }
 else   if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    operaLabel.setIcon(opera.getIconForEvent(captureEvent.event));
  }
 else   if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    safariLabel.setIcon(safari.getIconForEvent(captureEvent.event));
  }
 else   if (slave.getBrowserInfo().getName().contains("String_Node_Str")) {
    ieLabel.setIcon(ie.getIconForEvent(captureEvent.event));
  }
}
Program: 7034
Project: 7034
Buggy source:
public void update(Observable observable,Object event){
  if (observable instanceof JsTestDriverServer) {
switch ((JsTestDriverServer.Event)event) {
case STARTED:
      setStatus(Status.NO_BROWSERS);
    break;
case STOPPED:
  setStatus(Status.NOT_RUNNING);
break;
}
}
 else if (observable instanceof CapturedBrowsers) {
setStatus(Status.READY);
}
}

Fixed version (ground truth):
public void update(Observable observable,Object event){
  if (observable instanceof JsTestDriverServer) {
switch ((JsTestDriverServer.Event)event) {
case STARTED:
      setStatus(Status.NO_BROWSERS);
    break;
case STOPPED:
  setStatus(Status.NOT_RUNNING);
break;
}
}
 else if (observable instanceof CapturedBrowsers) {
if (((CapturedBrowsers)observable).getBrowsers().isEmpty()) {
setStatus(Status.NO_BROWSERS);
}
 else {
setStatus(Status.READY);
}
}
}
Program: 7035
Project: 7035
Buggy source:
/** 
 * Add the Browser startup and shutdown actions to the actions stack. 
 */
private void addBrowserControlActions(List<Action> actions){
  if (!browsers.isEmpty()) {
    BrowserStartupAction browserStartupAction=new BrowserStartupAction(browsers,remoteServerAddress,new SimpleProcessFactory(),new CountDownLatch(browsers.size()));
    capturedBrowsers.addObserver(browserStartupAction);
    actions.add(0,browserStartupAction);
    actions.add(new BrowserShutdownAction(browserStartupAction));
  }
}

Fixed version (ground truth):
/** 
 * Add the Browser startup and shutdown actions to the actions stack. 
 */
private void addBrowserControlActions(List<Action> actions){
  if (!browsers.isEmpty()) {
    BrowserStartupAction browserStartupAction=new BrowserStartupAction(browsers,remoteServerAddress,new SimpleProcessFactory(),new CountDownLatch(browsers.size()));
    capturedBrowsers.addObserver(browserStartupAction);
    actions.add(0,browserStartupAction);
    if (!leaveServerRunning()) {
      actions.add(new BrowserShutdownAction(browserStartupAction));
    }
  }
}
Program: 7036
Project: 7036
Buggy source:
@Override public void finished(){
  client=(Socket)getValue();
  try {
    in=new ObjectInputStream(client.getInputStream());
    while (true) {
      try {
        TestResultProtocolMessage message=(TestResultProtocolMessage)in.readObject();
        if (message.isDryRun()) {
          onTestStarted(message);
        }
 else {
          onTestFinished(message);
        }
      }
 catch (      EOFException e) {
        break;
      }
catch (      ClassNotFoundException e) {
        throw new RuntimeException(e);
      }
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void finished(){
  final Socket client=(Socket)getValue();
  ObjectInputStream in=null;
  try {
    in=new ObjectInputStream(client.getInputStream());
    while (true) {
      try {
        TestResultProtocolMessage message=(TestResultProtocolMessage)in.readObject();
        if (message.isDryRun()) {
          onTestStarted(message);
        }
 else {
          onTestFinished(message);
        }
      }
 catch (      EOFException e) {
        break;
      }
catch (      ClassNotFoundException e) {
        throw new RuntimeException(e);
      }
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
 finally {
    resultsLatch.countDown();
    try {
      if (client != null) {
        client.close();
      }
      if (in != null) {
        in.close();
      }
    }
 catch (    IOException e) {
    }
  }
}
Program: 7037
Project: 7037
Buggy source:
public void listen(final int port){
  SwingWorker worker=new SwingWorker(){
    public Object construct(){
      try {
        socket=new ServerSocket(port);
        return socket.accept();
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
    @Override public void finished(){
      client=(Socket)getValue();
      try {
        in=new ObjectInputStream(client.getInputStream());
        while (true) {
          try {
            TestResultProtocolMessage message=(TestResultProtocolMessage)in.readObject();
            if (message.isDryRun()) {
              onTestStarted(message);
            }
 else {
              onTestFinished(message);
            }
          }
 catch (          EOFException e) {
            break;
          }
catch (          ClassNotFoundException e) {
            throw new RuntimeException(e);
          }
        }
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
;
  worker.start();
}

Fixed version (ground truth):
public void listen(final int port){
  SwingWorker worker=new SwingWorker(){
    public Object construct(){
      try {
        socket=new ServerSocket(port);
        return socket.accept();
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
    @Override public void finished(){
      final Socket client=(Socket)getValue();
      ObjectInputStream in=null;
      try {
        in=new ObjectInputStream(client.getInputStream());
        while (true) {
          try {
            TestResultProtocolMessage message=(TestResultProtocolMessage)in.readObject();
            if (message.isDryRun()) {
              onTestStarted(message);
            }
 else {
              onTestFinished(message);
            }
          }
 catch (          EOFException e) {
            break;
          }
catch (          ClassNotFoundException e) {
            throw new RuntimeException(e);
          }
        }
      }
 catch (      IOException e) {
        throw new RuntimeException(e);
      }
 finally {
        resultsLatch.countDown();
        try {
          if (client != null) {
            client.close();
          }
          if (in != null) {
            in.close();
          }
        }
 catch (        IOException e) {
        }
      }
    }
  }
;
  worker.start();
}
Program: 7038
Project: 7038
Buggy source:
public void shutdown(){
  try {
    if (socket != null) {
      socket.close();
    }
    if (client != null) {
      client.close();
    }
    if (in != null) {
      in.close();
    }
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void shutdown(){
  try {
    resultsLatch.await();
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
  if (socket != null) {
    try {
      socket.close();
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 7040
Project: 7040
Buggy source:
public void close(){
  if (browsers.decrementAndGet() == 0) {
    out.println(String.format("String_Node_Str",(totalPasses.get() + totalFails.get() + totalErrors.get()),totalPasses.get(),totalFails.get(),totalErrors.get(),findMaxTime()));
    StringBuilder output=new StringBuilder();
    for (    Map.Entry<String,RunData> entry : browsersRunData.entrySet()) {
      RunData data=entry.getValue();
      out.println(String.format("String_Node_Str",entry.getKey(),(data.getPassed() + data.getFailed() + data.getErrors()),data.getPassed(),data.getFailed(),data.getErrors(),data.getTotalTime()));
      List<TestResult> problems=data.getProblems();
      for (      TestResult testResult : problems) {
        output.append(testResult.getLog() + NEW_LINE);
      }
    }
    if (output.length() > 0) {
      serializer.addOutput(output.toString());
    }
  }
  serializer.endTestSuite();
}

Fixed version (ground truth):
public void close(){
  if (browsers.decrementAndGet() == 0) {
    out.println(String.format("String_Node_Str",getTotalRan(),getTotalPassed(),getTotalFailed(),getTotalErrors(),findMaxTime()));
    StringBuilder output=new StringBuilder();
    for (    Map.Entry<String,RunData> entry : browsersRunData.entrySet()) {
      RunData data=entry.getValue();
      out.println(String.format("String_Node_Str",entry.getKey(),(data.getPassed() + data.getFailed() + data.getErrors()),data.getPassed(),data.getFailed(),data.getErrors(),data.getTotalTime()));
      List<TestResult> problems=data.getProblems();
      for (      TestResult testResult : problems) {
        output.append(testResult.getLog() + NEW_LINE);
      }
    }
    if (output.length() > 0) {
      serializer.addOutput(output.toString());
    }
  }
  serializer.endTestSuite();
}
Program: 7041
Project: 7041
Buggy source:
public void stop(){
  try {
    server.stop();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void stop(){
  try {
    server.stop();
    setChanged();
    notifyObservers(Event.STOPPED);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 7042
Project: 7042
Buggy source:
public void start(){
  try {
    server.start();
    setChanged();
    notifyObservers();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void start(){
  try {
    server.start();
    setChanged();
    notifyObservers(Event.STARTED);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 7043
Project: 7043
Buggy source:
public void update(Observable observable,Object o){
  if (observable instanceof JsTestDriverServer) {
    setStatus(Status.NO_BROWSERS);
  }
 else   if (observable instanceof CapturedBrowsers) {
    setStatus(Status.READY);
  }
}

Fixed version (ground truth):
public void update(Observable observable,Object event){
  if (observable instanceof JsTestDriverServer) {
switch ((JsTestDriverServer.Event)event) {
case STARTED:
      setStatus(Status.NO_BROWSERS);
    break;
case STOPPED:
  setStatus(Status.NOT_RUNNING);
break;
}
}
 else if (observable instanceof CapturedBrowsers) {
setStatus(Status.READY);
}
}
Program: 7044
Project: 7044
Buggy source:
public ResponseStream getRunTestsActionResponseStream(String browserId){
  String testSuiteName=String.format("String_Node_Str",browserId);
  TestResultPrinter printer=responsePrinterFactory.getResponsePrinter(String.format("String_Node_Str",configFileName,testSuiteName));
  printer.open(testSuiteName);
  RunTestsActionResponseStream responseStream=new RunTestsActionResponseStream(new TestResultGenerator(),printer);
  return responseStream;
}

Fixed version (ground truth):
public ResponseStream getRunTestsActionResponseStream(String browserId){
  String testSuiteName=String.format("String_Node_Str",browserId);
  TestResultPrinter printer=responsePrinterFactory.getResponsePrinter(String.format("String_Node_Str",new File(configFileName).getName(),testSuiteName));
  printer.open(testSuiteName);
  RunTestsActionResponseStream responseStream=new RunTestsActionResponseStream(new TestResultGenerator(),printer);
  return responseStream;
}
Program: 7045
Project: 7045
Buggy source:
public void run(){
  Collection<BrowserInfo> browsers=client.listBrowsers();
  int browsersNumber=browsers.size();
  if (browsersNumber == 0) {
    System.err.println("String_Node_Str");
  }
  CountDownLatch latch=new CountDownLatch(browsersNumber);
  for (  BrowserInfo browserInfo : browsers) {
    executor.submit(new ThreadedActionRunner(browserInfo.getId().toString(),client,latch,actions));
  }
  executor.shutdown();
  try {
    latch.await();
  }
 catch (  InterruptedException e) {
    System.err.println(e);
    System.exit(1);
  }
}

Fixed version (ground truth):
public void run(){
  Collection<BrowserInfo> browsers=client.listBrowsers();
  int browsersNumber=browsers.size();
  if (browsersNumber == 0) {
    System.err.println("String_Node_Str");
  }
  CountDownLatch latch=new CountDownLatch(browsersNumber);
  for (  BrowserInfo browserInfo : browsers) {
    executor.submit(new ThreadedActionRunner(browserInfo.getId().toString(),client,latch,actions));
  }
  executor.shutdown();
  try {
    latch.await();
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
}
Program: 7047
Project: 7047
Buggy source:
public void streamResponse(String id,PrintWriter writer){
  SlaveBrowser browser=capturedBrowsers.getBrowser(id);
  CommandResponse cmdResponse=browser.getResponse();
  String response="String_Node_Str" + cmdResponse.isLast() + "String_Node_Str"+ cmdResponse.getResponse()+ "String_Node_Str";
  writer.write(response);
}

Fixed version (ground truth):
public void streamResponse(String id,PrintWriter writer){
  SlaveBrowser browser=capturedBrowsers.getBrowser(id);
  CommandResponse cmdResponse=getResponse(browser);
  String response="String_Node_Str" + cmdResponse.isLast() + "String_Node_Str"+ cmdResponse.getResponse()+ "String_Node_Str";
  writer.write(response);
}
Program: 7049
Project: 7049
Buggy source:
public void run(){
  heartBeatManager.startTimer();
  String browserId=params.get("String_Node_Str");
  String sessionId=null;
  try {
    sessionId=startSession();
    if (!sessionId.equals("String_Node_Str")) {
      heartBeatManager.startHeartBeat(baseUrl,browserId,sessionId);
    }
    if (!isBrowserAlive()) {
      return;
    }
    if (upload) {
      uploadFileSet();
    }
    server.post(baseUrl + "String_Node_Str",params);
    StreamMessage streamMessage=null;
    do {
      String response=server.fetch(baseUrl + "String_Node_Str" + browserId);
      streamMessage=gson.fromJson(response,StreamMessage.class);
      stream.stream(streamMessage.getResponse());
    }
 while (streamMessage != null && !streamMessage.isLast());
  }
  finally {
    stream.finish();
    heartBeatManager.cancelTimer();
    stopSession(sessionId);
  }
}

Fixed version (ground truth):
public void run(){
  heartBeatManager.startTimer();
  String browserId=params.get("String_Node_Str");
  String sessionId=null;
  try {
    sessionId=startSession();
    if (!sessionId.equals("String_Node_Str")) {
      heartBeatManager.startHeartBeat(baseUrl,browserId,sessionId);
    }
    if (!isBrowserAlive()) {
      return;
    }
    if (upload) {
      uploadFileSet();
    }
    server.post(baseUrl + "String_Node_Str",params);
    StreamMessage streamMessage=null;
    do {
      String response=server.fetch(baseUrl + "String_Node_Str" + browserId);
      streamMessage=gson.fromJson(response,StreamMessage.class);
      Response resObj=streamMessage.getResponse();
      shouldPanic(resObj.getResponse());
      stream.stream(resObj);
    }
 while (streamMessage != null && !streamMessage.isLast());
  }
  finally {
    stream.finish();
    heartBeatManager.cancelTimer();
    stopSession(sessionId);
  }
}
Program: 7050
Project: 7050
Buggy source:
public CommandResponse getResponse(){
  try {
    return responses.take();
  }
 catch (  InterruptedException e) {
    return null;
  }
}

Fixed version (ground truth):
public CommandResponse getResponse(){
  try {
    return responses.poll(POLL_RESPONSE_TIMEOUT,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    return null;
  }
}
Program: 7051
Project: 7051
Buggy source:
public void testGetRunTestsActionResponseStream() throws Exception {
  CoverageResponseStreamFactory factory=new CoverageResponseStreamFactory(new DefaultResponseStreamFactory(new ResponsePrinterFactory(){
    public TestResultPrinter getResponsePrinter(    String xmlFile){
      return printer;
    }
  }
),null);
  ResponseStream responseStream=factory.getRunTestsActionResponseStream("String_Node_Str");
  assertNotNull(responseStream);
}

Fixed version (ground truth):
public void testGetRunTestsActionResponseStream() throws Exception {
  CoverageResponseStreamFactory factory=new CoverageResponseStreamFactory(new DefaultResponseStreamFactory(new ResponsePrinterFactory(){
    public TestResultPrinter getResponsePrinter(    String xmlFile){
      return printer;
    }
  }
,"String_Node_Str"),null);
  ResponseStream responseStream=factory.getRunTestsActionResponseStream("String_Node_Str");
  assertNotNull(responseStream);
}
Program: 7052
Project: 7052
Buggy source:
@Inject public DefaultResponseStreamFactory(ResponsePrinterFactory responsePrinterFactory){
  this.responsePrinterFactory=responsePrinterFactory;
}

Fixed version (ground truth):
@Inject public DefaultResponseStreamFactory(ResponsePrinterFactory responsePrinterFactory,@Named("String_Node_Str") String configFileName){
  this.responsePrinterFactory=responsePrinterFactory;
  this.configFileName=configFileName;
}
Program: 7053
Project: 7053
Buggy source:
public ResponseStream getRunTestsActionResponseStream(String browserId){
  String testSuiteName=String.format("String_Node_Str",browserId);
  TestResultPrinter printer=responsePrinterFactory.getResponsePrinter(String.format("String_Node_Str",testSuiteName));
  printer.open(testSuiteName);
  RunTestsActionResponseStream responseStream=new RunTestsActionResponseStream(new TestResultGenerator(),printer);
  return responseStream;
}

Fixed version (ground truth):
public ResponseStream getRunTestsActionResponseStream(String browserId){
  String testSuiteName=String.format("String_Node_Str",browserId);
  TestResultPrinter printer=responsePrinterFactory.getResponsePrinter(String.format("String_Node_Str",configFileName,testSuiteName));
  printer.open(testSuiteName);
  RunTestsActionResponseStream responseStream=new RunTestsActionResponseStream(new TestResultGenerator(),printer);
  return responseStream;
}