nus-yam/ex-repair huggingface dataset:
Program: 7054
Project: 7054
Buggy source:
@Provides @Inject public CoverageWriter createCoverageWriter(@Named("String_Node_Str") String testOut,@Named("String_Node_Str") PrintStream out){
  if (testOut.length() > 0) {
    try {
      File testOutDir=new File(testOut);
      if (!testOutDir.exists()) {
        testOutDir.mkdirs();
      }
      File coverageFile=new File(testOutDir,"String_Node_Str");
      if (coverageFile.exists()) {
        coverageFile.delete();
      }
      coverageFile.createNewFile();
      return new LcovWriter(new FileWriter(coverageFile));
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
  return new SummaryCoverageWriter(out);
}

Fixed version (ground truth):
@Provides @Inject public CoverageWriter createCoverageWriter(@Named("String_Node_Str") String testOut,@Named("String_Node_Str") String configFileName,@Named("String_Node_Str") PrintStream out){
  if (testOut.length() > 0) {
    try {
      File testOutDir=new File(testOut);
      if (!testOutDir.exists()) {
        testOutDir.mkdirs();
      }
      File coverageFile=new File(testOutDir,String.format("String_Node_Str",configFileName));
      if (coverageFile.exists()) {
        coverageFile.delete();
      }
      coverageFile.createNewFile();
      return new LcovWriter(new FileWriter(coverageFile));
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
  return new SummaryCoverageWriter(out);
}
Program: 7055
Project: 7055
Buggy source:
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  String id=req.getParameter("String_Node_Str");
  SlaveBrowser browser=capturedBrowsers.getBrowser(id);
  if (browser != null) {
    browser.heartBeat();
  }
  resp.getWriter().flush();
}

Fixed version (ground truth):
/** 
 * Used by the browser to report if it is still alive.
 */
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  String id=req.getParameter("String_Node_Str");
  SlaveBrowser browser=capturedBrowsers.getBrowser(id);
  if (browser != null) {
    browser.heartBeat();
  }
  resp.getWriter().flush();
}
Program: 7056
Project: 7056
Buggy source:
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  PrintWriter writer=resp.getWriter();
  String id=req.getParameter("String_Node_Str");
  if (id != null) {
    SlaveBrowser browser=capturedBrowsers.getBrowser(id);
    if (browser != null) {
      if ((time.now().getMillis() - browser.getLastHeartBeat().getMillis()) > TIMEOUT) {
        capturedBrowsers.removeSlave(id);
        writer.write("String_Node_Str");
      }
 else {
        writer.write("String_Node_Str");
      }
    }
 else {
      writer.write("String_Node_Str");
    }
  }
 else {
    writer.write("String_Node_Str");
  }
  writer.flush();
}

Fixed version (ground truth):
/** 
 * Used by the client to know if the browser is alive.
 */
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  PrintWriter writer=resp.getWriter();
  String id=req.getParameter("String_Node_Str");
  if (id != null) {
    SlaveBrowser browser=capturedBrowsers.getBrowser(id);
    if (browser != null) {
      if ((time.now().getMillis() - browser.getLastHeartBeat().getMillis()) > TIMEOUT) {
        capturedBrowsers.removeSlave(id);
        writer.write("String_Node_Str");
      }
 else {
        writer.write("String_Node_Str");
      }
    }
 else {
      writer.write("String_Node_Str");
    }
  }
 else {
    writer.write("String_Node_Str");
  }
  writer.flush();
}
Program: 7057
Project: 7057
Buggy source:
public void testProcessRun() throws Exception {
  CountDownLatchFake latch=new CountDownLatchFake(1,false,true);
  final String browserPath="String_Node_Str";
  final String serverAddress="String_Node_Str";
  final BrowserStartupAction action=new BrowserStartupAction(Arrays.asList(browserPath),serverAddress,new ProcessFactory(){
    public Process start(    String... commands) throws IOException {
      return new ProcessStub(commands);
    }
  }
,latch);
  action.run();
  assertFalse(action.getProcesses().isEmpty());
  assertEquals(new ProcessStub(new String[]{browserPath,serverAddress + "String_Node_Str"}),action.getProcesses().get(0));
}

Fixed version (ground truth):
public void testProcessRun() throws Exception {
  CountDownLatchFake latch=new CountDownLatchFake(1,false,true);
  final String browserPath="String_Node_Str";
  final String serverAddress="String_Node_Str";
  final BrowserStartupAction action=new BrowserStartupAction(Arrays.asList(browserPath),serverAddress,new ProcessFactory(){
    public Process start(    String... commands){
      return new ProcessStub(commands);
    }
  }
,latch);
  action.run();
  assertFalse(action.getProcesses().isEmpty());
  assertEquals(new ProcessStub(new String[]{browserPath,serverAddress + "String_Node_Str"}),action.getProcesses().get(0));
}
Program: 7058
Project: 7058
Buggy source:
@Override public boolean await(long timeoutPassed,TimeUnit unit) throws InterruptedException {
  return awaitResponse;
}

Fixed version (ground truth):
@Override public boolean await(long timeoutPassed,TimeUnit unit){
  return awaitResponse;
}
Program: 7059
Project: 7059
Buggy source:
@Override public int waitFor() throws InterruptedException {
  return 0;
}

Fixed version (ground truth):
@Override public int waitFor(){
  return 0;
}
Program: 7060
Project: 7060
Buggy source:
public void testRewriteUrls() throws Exception {
  CapturedBrowsers capturedBrowsers=new CapturedBrowsers();
  BrowserInfo browserInfo=new BrowserInfo();
  browserInfo.setId(1);
  SlaveBrowser slave=new SlaveBrowser(new TimeImpl(),"String_Node_Str",browserInfo);
  capturedBrowsers.addSlave(slave);
  CommandServlet servlet=new CommandServlet(capturedBrowsers,new URLTranslator(new IdGenerator(){
    private int i=1;
    public String generate(){
      return Integer.toString(i++);
    }
  }
),new ForwardingMapper());
  List<String> parameters=Lists.newArrayList();
  List<FileSource> fileSources=Lists.newArrayList();
  fileSources.add(new FileSource("String_Node_Str",-1));
  fileSources.add(new FileSource("String_Node_Str",-1));
  parameters.add(gson.toJson(fileSources));
  parameters.add("String_Node_Str");
  JsonCommand command=new JsonCommand(CommandType.LOADTEST,parameters);
  servlet.service("String_Node_Str",gson.toJson(command));
  Command cmd=slave.dequeueCommand();
  command=gson.fromJson(cmd.getCommand(),JsonCommand.class);
  assertEquals(2,command.getParameters().size());
  List<FileSource> changedFileSources=gson.fromJson(command.getParameters().get(0),new TypeToken<List<FileSource>>(){
  }
.getType());
  assertEquals(2,changedFileSources.size());
  assertEquals("String_Node_Str",changedFileSources.get(0).getFileSrc());
  assertEquals("String_Node_Str",changedFileSources.get(0).getBasePath());
  assertEquals("String_Node_Str",changedFileSources.get(1).getFileSrc());
  assertEquals("String_Node_Str",changedFileSources.get(1).getBasePath());
}

Fixed version (ground truth):
public void testRewriteUrls() throws Exception {
  CapturedBrowsers capturedBrowsers=new CapturedBrowsers();
  BrowserInfo browserInfo=new BrowserInfo();
  browserInfo.setId(1);
  SlaveBrowser slave=new SlaveBrowser(new TimeImpl(),"String_Node_Str",browserInfo);
  capturedBrowsers.addSlave(slave);
  CommandServlet servlet=new CommandServlet(capturedBrowsers,new URLTranslator(),new ForwardingMapper());
  List<String> parameters=Lists.newArrayList();
  List<FileSource> fileSources=Lists.newArrayList();
  fileSources.add(new FileSource("String_Node_Str",-1));
  fileSources.add(new FileSource("String_Node_Str",-1));
  parameters.add(gson.toJson(fileSources));
  parameters.add("String_Node_Str");
  JsonCommand command=new JsonCommand(CommandType.LOADTEST,parameters);
  servlet.service("String_Node_Str",gson.toJson(command));
  Command cmd=slave.dequeueCommand();
  command=gson.fromJson(cmd.getCommand(),JsonCommand.class);
  assertEquals(2,command.getParameters().size());
  List<FileSource> changedFileSources=gson.fromJson(command.getParameters().get(0),new TypeToken<List<FileSource>>(){
  }
.getType());
  assertEquals(2,changedFileSources.size());
  assertEquals("String_Node_Str",changedFileSources.get(0).getFileSrc());
  assertEquals("String_Node_Str",changedFileSources.get(0).getBasePath());
  assertEquals("String_Node_Str",changedFileSources.get(1).getFileSrc());
  assertEquals("String_Node_Str",changedFileSources.get(1).getBasePath());
}
Program: 7061
Project: 7061
Buggy source:
public void testUrlHasPort() throws Exception {
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  forwardingMapper.addForwardingMapping("String_Node_Str","String_Node_Str");
  ForwardingServlet servlet=new ForwardingServlet(forwardingMapper);
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str","String_Node_Str",null).toString());
}

Fixed version (ground truth):
public void testUrlHasPort() throws Exception {
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  forwardingMapper.addForwardingMapping("String_Node_Str","String_Node_Str");
  ForwardingServlet servlet=new ForwardingServlet(forwardingMapper);
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str",null).toString());
}
Program: 7062
Project: 7062
Buggy source:
public void testUrlHasIdAndNoReferer() throws Exception {
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  forwardingMapper.addForwardingMapping("String_Node_Str","String_Node_Str");
  ForwardingServlet servlet=new ForwardingServlet(forwardingMapper);
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str","String_Node_Str",null).toString());
}

Fixed version (ground truth):
public void testUrlHasIdAndNoReferer() throws Exception {
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  forwardingMapper.addForwardingMapping("String_Node_Str","String_Node_Str");
  ForwardingServlet servlet=new ForwardingServlet(forwardingMapper);
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str",null).toString());
}
Program: 7063
Project: 7063
Buggy source:
public void testMultipleLevelUrlRequest() throws Exception {
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  forwardingMapper.addForwardingMapping("String_Node_Str","String_Node_Str");
  ForwardingServlet servlet=new ForwardingServlet(forwardingMapper);
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str","String_Node_Str",null).toString());
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str",null,"String_Node_Str").toString());
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str",null,"String_Node_Str").toString());
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str",null,"String_Node_Str").toString());
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str",null,"String_Node_Str").toString());
}

Fixed version (ground truth):
public void testMultipleLevelUrlRequest() throws Exception {
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  forwardingMapper.addForwardingMapping("String_Node_Str","String_Node_Str");
  ForwardingServlet servlet=new ForwardingServlet(forwardingMapper);
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str",null).toString());
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str","String_Node_Str").toString());
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str","String_Node_Str").toString());
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str","String_Node_Str").toString());
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str","String_Node_Str").toString());
}
Program: 7064
Project: 7064
Buggy source:
public void testUrlHasIdOnReferer() throws Exception {
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  forwardingMapper.addForwardingMapping("String_Node_Str","String_Node_Str");
  ForwardingServlet servlet=new ForwardingServlet(forwardingMapper);
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str",null,"String_Node_Str").toString());
}

Fixed version (ground truth):
public void testUrlHasIdOnReferer() throws Exception {
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  forwardingMapper.addForwardingMapping("String_Node_Str","String_Node_Str");
  ForwardingServlet servlet=new ForwardingServlet(forwardingMapper);
  assertEquals("String_Node_Str",servlet.getForwardingUrl("String_Node_Str","String_Node_Str",42,"String_Node_Str","String_Node_Str").toString());
}
Program: 7065
Project: 7065
Buggy source:
public void testRetrieveOriginal() throws Exception {
  IdGenerator idGenerator=new FakeIdGenerator(ID);
  URLTranslator urlTranslator=new URLTranslator(idGenerator);
  urlTranslator.translate(ORIGINAL_URL);
  assertEquals(ORIGINAL_URL,urlTranslator.getOriginal(urlTranslator.getTranslation(ORIGINAL_URL)));
}

Fixed version (ground truth):
public void testRetrieveOriginal() throws Exception {
  URLTranslator urlTranslator=new URLTranslator();
  urlTranslator.translate(ORIGINAL_URL);
  assertEquals(ORIGINAL_URL,urlTranslator.getOriginal(urlTranslator.getTranslation(ORIGINAL_URL)));
}
Program: 7066
Project: 7066
Buggy source:
public void testClearUrlTranslatorCache() throws Exception {
  IdGenerator idGenerator=new FakeIdGenerator(ID);
  URLTranslator urlTranslator=new URLTranslator(idGenerator);
  urlTranslator.translate(ORIGINAL_URL);
  urlTranslator.clear();
  assertNull(urlTranslator.getOriginal(urlTranslator.getTranslation(ORIGINAL_URL)));
}

Fixed version (ground truth):
public void testClearUrlTranslatorCache() throws Exception {
  URLTranslator urlTranslator=new URLTranslator();
  urlTranslator.translate(ORIGINAL_URL);
  urlTranslator.clear();
  assertNull(urlTranslator.getOriginal(urlTranslator.getTranslation(ORIGINAL_URL)));
}
Program: 7067
Project: 7067
Buggy source:
public void testTranslateUrl() throws Exception {
  IdGenerator idGenerator=new FakeIdGenerator(ID);
  URLTranslator urlTranslator=new URLTranslator(idGenerator);
  urlTranslator.translate(ORIGINAL_URL);
  assertEquals(TRANSLATED_URL,urlTranslator.getTranslation(ORIGINAL_URL));
}

Fixed version (ground truth):
public void testTranslateUrl() throws Exception {
  URLTranslator urlTranslator=new URLTranslator();
  urlTranslator.translate(ORIGINAL_URL);
  assertEquals(TRANSLATED_URL,urlTranslator.getTranslation(ORIGINAL_URL));
}
Program: 7069
Project: 7069
Buggy source:
private String translateUrls(String data){
  JsonCommand command=gson.fromJson(data,JsonCommand.class);
  if (command.getCommand().equals(JsonCommand.CommandType.LOADTEST.getCommand())) {
    List<String> parameters=command.getParameters();
    String fileSourcesList=parameters.get(0);
    List<FileSource> fileSources=gson.fromJson(fileSourcesList,new TypeToken<List<FileSource>>(){
    }
.getType());
    for (    FileSource fileSource : fileSources) {
      String url=fileSource.getFileSrc();
      if (url.startsWith("String_Node_Str") || url.startsWith("String_Node_Str")) {
        String translation=urlTranslator.getTranslation(url);
        if (translation == null) {
          urlTranslator.translate(url);
          translation=urlTranslator.getTranslation(url);
          URLQueryParser parser=new URLQueryParser(translation);
          parser.parse();
          forwardingMapper.addForwardingMapping(parser.getParameter("String_Node_Str"),url);
        }
        fileSource.setBasePath(url);
        fileSource.setFileSource(translation);
      }
    }
    parameters.remove(0);
    parameters.add(0,gson.toJson(fileSources));
    return gson.toJson(command);
  }
  return data;
}

Fixed version (ground truth):
private String translateUrls(String data){
  JsonCommand command=gson.fromJson(data,JsonCommand.class);
  if (command.getCommand().equals(JsonCommand.CommandType.LOADTEST.getCommand())) {
    List<String> parameters=command.getParameters();
    String fileSourcesList=parameters.get(0);
    List<FileSource> fileSources=gson.fromJson(fileSourcesList,new TypeToken<List<FileSource>>(){
    }
.getType());
    for (    FileSource fileSource : fileSources) {
      String url=fileSource.getFileSrc();
      if (url.startsWith("String_Node_Str") || url.startsWith("String_Node_Str")) {
        String translation=urlTranslator.getTranslation(url);
        if (translation == null) {
          try {
            urlTranslator.translate(url);
            translation=urlTranslator.getTranslation(url);
            forwardingMapper.addForwardingMapping(translation,url);
          }
 catch (          MalformedURLException e) {
            LOGGER.warn("String_Node_Str" + url + "String_Node_Str",e);
            translation=url;
          }
        }
        fileSource.setBasePath(url);
        fileSource.setFileSource(translation);
      }
    }
    parameters.remove(0);
    parameters.add(0,gson.toJson(fileSources));
    return gson.toJson(command);
  }
  return data;
}
Program: 7070
Project: 7070
Buggy source:
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  service(req.getParameter("String_Node_Str"),req.getParameter("String_Node_Str"));
}

Fixed version (ground truth):
@Override protected void doPost(HttpServletRequest req,HttpServletResponse resp){
  service(req.getParameter("String_Node_Str"),req.getParameter("String_Node_Str"));
}
Program: 7071
Project: 7071
Buggy source:
public URL getForwardingUrl(String scheme,String serverName,int serverPort,String uri,String jstdid,String referer) throws MalformedURLException {
  if (jstdid != null) {
    return new URL(forwardingMapper.getForwardTo(jstdid));
  }
  String incomingUrl=String.format("String_Node_Str",scheme,serverName,serverPort,uri);
  URL refererUrl=new URL(referer);
  URLQueryParser urlQueryParser=new URLQueryParser(refererUrl.getQuery());
  urlQueryParser.parse();
  jstdid=urlQueryParser.getParameter("String_Node_Str");
  if (jstdid != null) {
    String forwardTo=forwardingMapper.getForwardTo(jstdid);
    URL forwardUrl=new URL(forwardTo);
    StringBuilder sb=new StringBuilder();
    sb.append(forwardUrl.getProtocol());
    sb.append("String_Node_Str");
    sb.append(forwardUrl.getHost());
    int port=forwardUrl.getPort();
    if (port != -1) {
      sb.append("String_Node_Str");
      sb.append(Integer.toString(port));
    }
    String baseUrl=sb.toString();
    String finalUrl=baseUrl + uri;
    forwardingMapper.addForwardingMapping(incomingUrl,baseUrl);
    return new URL(finalUrl);
  }
 else {
    String baseUrl=forwardingMapper.getForwardTo(referer);
    forwardingMapper.addForwardingMapping(incomingUrl,baseUrl);
    return new URL(baseUrl + uri);
  }
}

Fixed version (ground truth):
public URL getForwardingUrl(String scheme,String serverName,int serverPort,String uri,String referer) throws MalformedURLException {
  String forwardTo=forwardingMapper.getForwardTo(uri);
  if (forwardTo != null) {
    return new URL(forwardTo);
  }
  String incomingUrl=String.format("String_Node_Str",scheme,serverName,serverPort,uri);
  URL refererUrl=new URL(referer);
  forwardTo=forwardingMapper.getForwardTo(refererUrl.getPath());
  if (forwardTo != null) {
    URL forwardUrl=new URL(forwardTo);
    StringBuilder sb=new StringBuilder();
    sb.append(forwardUrl.getProtocol());
    sb.append("String_Node_Str");
    sb.append(forwardUrl.getHost());
    int port=forwardUrl.getPort();
    if (port != -1) {
      sb.append("String_Node_Str");
      sb.append(Integer.toString(port));
    }
    String baseUrl=sb.toString();
    String finalUrl=baseUrl + uri;
    forwardingMapper.addForwardingMapping(incomingUrl,baseUrl);
    return new URL(finalUrl);
  }
 else {
    String baseUrl=forwardingMapper.getForwardTo(referer);
    forwardingMapper.addForwardingMapping(incomingUrl,baseUrl);
    return new URL(baseUrl + uri);
  }
}
Program: 7072
Project: 7072
Buggy source:
@Override protected URL proxyHttpURL(String scheme,String serverName,int serverPort,String uri) throws MalformedURLException {
  if (!uri.equals("String_Node_Str")) {
    HttpServletRequest request=threadLocal.get();
    return getForwardingUrl(scheme,serverName,serverPort,uri,request.getParameter("String_Node_Str"),request.getHeader("String_Node_Str"));
  }
 else {
    return super.proxyHttpURL(scheme,serverName,serverPort,uri);
  }
}

Fixed version (ground truth):
@Override protected URL proxyHttpURL(String scheme,String serverName,int serverPort,String uri) throws MalformedURLException {
  HttpServletRequest request=threadLocal.get();
  return getForwardingUrl(scheme,serverName,serverPort,uri,request.getHeader("String_Node_Str"));
}
Program: 7073
Project: 7073
Buggy source:
private void initServlets(){
  URLTranslator urlTranslator=new URLTranslator(new UUIDIdGenerator());
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  addServlet("String_Node_Str",new HelloServlet());
  addServlet("String_Node_Str",new HeartbeatServlet(capturedBrowsers,new TimeImpl()));
  addServlet("String_Node_Str",new CaptureServlet(new BrowserHunter(capturedBrowsers)));
  addServlet("String_Node_Str",new StandaloneRunnerServlet(new BrowserHunter(capturedBrowsers),filesCache,new StandaloneRunnerFilesFilterImpl(),new SlaveResourceService(SlaveResourceService.RESOURCE_LOCATION)));
  addServlet("String_Node_Str",new SlaveResourceServlet(new SlaveResourceService(SlaveResourceService.RESOURCE_LOCATION)));
  addServlet("String_Node_Str",new CommandServlet(capturedBrowsers,urlTranslator,forwardingMapper));
  addServlet("String_Node_Str",new BrowserQueryResponseServlet(capturedBrowsers,urlTranslator,forwardingMapper));
  addServlet("String_Node_Str",new FileSetServlet(capturedBrowsers,filesCache));
  addServlet("String_Node_Str",new TestResourceServlet(filesCache));
  addServlet("String_Node_Str",new HomeServlet(capturedBrowsers));
  addServlet("String_Node_Str",new ForwardingServlet(forwardingMapper));
}

Fixed version (ground truth):
private void initServlets(){
  URLTranslator urlTranslator=new URLTranslator();
  ForwardingMapper forwardingMapper=new ForwardingMapper();
  addServlet("String_Node_Str",new HelloServlet());
  addServlet("String_Node_Str",new HeartbeatServlet(capturedBrowsers,new TimeImpl()));
  addServlet("String_Node_Str",new CaptureServlet(new BrowserHunter(capturedBrowsers)));
  addServlet("String_Node_Str",new StandaloneRunnerServlet(new BrowserHunter(capturedBrowsers),filesCache,new StandaloneRunnerFilesFilterImpl(),new SlaveResourceService(SlaveResourceService.RESOURCE_LOCATION)));
  addServlet("String_Node_Str",new SlaveResourceServlet(new SlaveResourceService(SlaveResourceService.RESOURCE_LOCATION)));
  addServlet("String_Node_Str",new CommandServlet(capturedBrowsers,urlTranslator,forwardingMapper));
  addServlet("String_Node_Str",new BrowserQueryResponseServlet(capturedBrowsers,urlTranslator,forwardingMapper));
  addServlet("String_Node_Str",new FileSetServlet(capturedBrowsers,filesCache));
  addServlet("String_Node_Str",new TestResourceServlet(filesCache));
  addServlet("String_Node_Str",new HomeServlet(capturedBrowsers));
  addServlet("String_Node_Str",new ForwardingServlet(forwardingMapper));
}
Program: 7075
Project: 7075
Buggy source:
/** 
 * For each plugin, the specified jar is loaded, then the specified class is extracted from the Jar.
 * @return 
 */
@SuppressWarnings("String_Node_Str") public List<Module> load(List<Plugin> plugins){
  List<Module> modules=new LinkedList<Module>();
  for (  Plugin plugin : plugins) {
    try {
      URLClassLoader urlClassLoader=new URLClassLoader(new URL[]{new URL("String_Node_Str" + plugin.getPathToJar() + "String_Node_Str")},getClass().getClassLoader());
      Class<?> module=Class.forName(plugin.getModuleName(),true,urlClassLoader);
      modules.add(((Class<? extends Module>)Module.class.asSubclass(module)).newInstance());
    }
 catch (    InstantiationException e) {
      throw new RuntimeException(e);
    }
catch (    IllegalAccessException e) {
      throw new RuntimeException(e);
    }
catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
catch (    ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
  return modules;
}

Fixed version (ground truth):
/** 
 * For each plugin, the specified jar is loaded, then the specified class is extracted from the Jar.
 * @return a list of {@code Module}
 */
@SuppressWarnings("String_Node_Str") public List<Module> load(List<Plugin> plugins){
  List<Module> modules=new LinkedList<Module>();
  for (  Plugin plugin : plugins) {
    try {
      URLClassLoader urlClassLoader=new URLClassLoader(new URL[]{new URL("String_Node_Str" + plugin.getPathToJar() + "String_Node_Str")},getClass().getClassLoader());
      Class<?> module=Class.forName(plugin.getModuleName(),true,urlClassLoader);
      modules.add(((Class<? extends Module>)Module.class.asSubclass(module)).newInstance());
    }
 catch (    InstantiationException e) {
      throw new RuntimeException(e);
    }
catch (    IllegalAccessException e) {
      throw new RuntimeException(e);
    }
catch (    MalformedURLException e) {
      throw new RuntimeException(e);
    }
catch (    ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
  return modules;
}
Program: 7076
Project: 7076
Buggy source:
public void translate(String url){
  cache.put(url,"String_Node_Str" + idGenerator.generate());
}

Fixed version (ground truth):
public void translate(String url) throws MalformedURLException {
  URL netUrl=new URL(url);
  String file=netUrl.getFile();
  if (file.length() == 0) {
    file="String_Node_Str";
  }
  cache.put(url,file);
}
Program: 7077
Project: 7077
Buggy source:
@Override protected URL proxyHttpURL(String scheme,String serverName,int serverPort,String uri) throws MalformedURLException {
  HttpServletRequest request=threadLocal.get();
  return getForwardingUrl(scheme,serverName,serverPort,uri,request.getParameter("String_Node_Str"),request.getHeader("String_Node_Str"));
}

Fixed version (ground truth):
@Override protected URL proxyHttpURL(String scheme,String serverName,int serverPort,String uri) throws MalformedURLException {
  if (!uri.equals("String_Node_Str")) {
    HttpServletRequest request=threadLocal.get();
    return getForwardingUrl(scheme,serverName,serverPort,uri,request.getParameter("String_Node_Str"),request.getHeader("String_Node_Str"));
  }
 else {
    return super.proxyHttpURL(scheme,serverName,serverPort,uri);
  }
}
Program: 7078
Project: 7078
Buggy source:
@Override protected void configure(){
  bind(PrintStream.class).annotatedWith(Names.named("String_Node_Str")).toInstance(out);
  bind(ResponsePrinterFactory.class).to(XmlResponsePrinterFactory.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(PrintStream.class).annotatedWith(Names.named("String_Node_Str")).toInstance(out);
  bind(ResponsePrinterFactory.class).to(PrintStreamResponsePrinterFactory.class);
}
Program: 7080
Project: 7080
Buggy source:
public void widgetSelected(SelectionEvent e){
  try {
    if (pathToBrowser == null || "String_Node_Str".equals(pathToBrowser.trim())) {
      return;
    }
    int port=Activator.getDefault().getPreferenceStore().getInt(WorkbenchPreferencePage.PREFERRED_SERVER_PORT);
    String serverUrl=format(Server.SERVER_CAPTURE_URL,port);
    String os=System.getProperty("String_Node_Str");
    if (os.toLowerCase().contains("String_Node_Str")) {
      String[] cmd=new String[]{"String_Node_Str","String_Node_Str",pathToBrowser,serverUrl};
      Runtime.getRuntime().exec(cmd);
    }
 else {
      String[] cmd=new String[]{pathToBrowser,serverUrl};
      Runtime.getRuntime().exec(cmd);
    }
  }
 catch (  IOException ioe) {
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  try {
    String pathToBrowser=preferenceStore.getString(browserName);
    if (pathToBrowser == null || "String_Node_Str".equals(pathToBrowser.trim())) {
      return;
    }
    int port=preferenceStore.getInt(WorkbenchPreferencePage.PREFERRED_SERVER_PORT);
    String serverUrl=format(Server.SERVER_CAPTURE_URL,port);
    String os=System.getProperty("String_Node_Str");
    if (os.toLowerCase().contains("String_Node_Str")) {
      String[] cmd=new String[]{"String_Node_Str","String_Node_Str",pathToBrowser,serverUrl};
      Runtime.getRuntime().exec(cmd);
    }
 else {
      String[] cmd=new String[]{pathToBrowser,serverUrl};
      Runtime.getRuntime().exec(cmd);
    }
  }
 catch (  IOException ioe) {
  }
}
Program: 7081
Project: 7081
Buggy source:
public BrowserLaunchCapableSelectionListener(String pathToBrowser){
  this.pathToBrowser=pathToBrowser;
}

Fixed version (ground truth):
public BrowserLaunchCapableSelectionListener(IPreferenceStore preferenceStore,String browserName){
  this.preferenceStore=preferenceStore;
  this.browserName=browserName;
}
Program: 7082
Project: 7082
Buggy source:
public FileSource getFileSource(){
  return fileSource;
}

Fixed version (ground truth):
public FileSource getFileSource(){
  return file;
}
Program: 7084
Project: 7084
Buggy source:
private Set<FileInfo> filterServeOnlyFiles(Collection<FileInfo> clientFileSet,Set<FileInfo> filesToRequest){
  Set<FileInfo> filteredFilesToRequest=new LinkedHashSet<FileInfo>();
  Set<String> cachedFiles=filesCache.getAllFileNames();
  for (  FileInfo fileInfo : clientFileSet) {
    if (filesToRequest.contains(fileInfo)) {
      if (!fileInfo.isServeOnly() || !cachedFiles.contains(fileInfo.getFileName()) || filesCache.getFileInfo(fileInfo.getFileName()).getTimestamp() < fileInfo.getTimestamp()) {
        filteredFilesToRequest.add(fileInfo);
      }
    }
  }
  return filteredFilesToRequest;
}

Fixed version (ground truth):
private Set<FileInfo> filterServeOnlyFiles(Set<FileInfo> filesToRequest){
  Set<FileInfo> filteredFilesToRequest=new LinkedHashSet<FileInfo>();
  Set<String> cachedFiles=filesCache.getAllFileNames();
  for (  FileInfo fileInfo : filesToRequest) {
    if (!fileInfo.isServeOnly() || !cachedFiles.contains(fileInfo.getFileName()) || filesCache.getFileInfo(fileInfo.getFileName()).getTimestamp() < fileInfo.getTimestamp()) {
      filteredFilesToRequest.add(fileInfo);
    }
  }
  return filteredFilesToRequest;
}
Program: 7085
Project: 7085
Buggy source:
public String getBasePath(){
  if (basePath.equals("String_Node_Str")) {
    basePath=fileSrc.substring(6);
  }
  return basePath;
}

Fixed version (ground truth):
public String getBasePath(){
  if (basePath == null) {
    basePath=fileSrc.substring(6);
  }
  return basePath;
}
Program: 7086
Project: 7086
Buggy source:
public void addFiles(Set<FileInfo> fileSet){
  this.fileSet.removeAll(fileSet);
  this.fileSet.addAll(fileSet);
}

Fixed version (ground truth):
public void addFiles(Collection<FileInfo> fileSet){
  this.fileSet.removeAll(fileSet);
  this.fileSet.addAll(fileSet);
}
Program: 7088
Project: 7088
Buggy source:
public void testGetBrowserName() throws Exception {
  UserAgentParser parser=null;
  parser=new UserAgentParser();
  parser.parse(CHROME_WINDOWS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(FIREFOX_WINDOWS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(FIREFOX_LINUX);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(FIREFOX_MACOS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(SAFARI_WINDOWS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(SAFARI_MACOS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(IE_WINDOWS);
  assertEquals("String_Node_Str",parser.getName());
}

Fixed version (ground truth):
public void testGetBrowserName() throws Exception {
  UserAgentParser parser=null;
  parser=new UserAgentParser();
  parser.parse(CHROME_WINDOWS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(FIREFOX_WINDOWS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(FIREFOX_LINUX);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(FIREFOX_MACOS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(SAFARI_WINDOWS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(SAFARI_MACOS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse(IE_WINDOWS);
  assertEquals("String_Node_Str",parser.getName());
  parser=new UserAgentParser();
  parser.parse("String_Node_Str");
  assertEquals("String_Node_Str",parser.getName());
}
Program: 7089
Project: 7089
Buggy source:
private boolean sameFiles(Collection<FileInfo> filesToUpload,List<FileInfo> fileSet){
  if (filesToUpload.size() != fileSet.size()) {
    return false;
  }
  for (  FileInfo info : fileSet) {
    if (!filesToUpload.contains(info)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean sameFiles(Collection<FileInfo> filesToUpload,List<FileInfo> fileSet){
  for (  FileInfo info : fileSet) {
    if (!info.isServeOnly() && !filesToUpload.contains(info)) {
      return false;
    }
  }
  return true;
}
Program: 7090
Project: 7090
Buggy source:
public void checkFileSet(String fileSet,String browserId,PrintWriter writer){
  Collection<FileInfo> clientFileSet=gson.fromJson(fileSet,new TypeToken<Collection<FileInfo>>(){
  }
.getType());
  SlaveBrowser browser=capturedBrowsers.getBrowser(browserId);
  Set<FileInfo> browserFileSet=browser.getFileSet();
  Set<FileInfo> filesToRequest=new LinkedHashSet<FileInfo>();
  if (browserFileSet.isEmpty() || !clientFileSet.containsAll(browserFileSet)) {
    for (    FileInfo info : clientFileSet) {
      filesToRequest.add(info);
    }
  }
 else {
    Set<FileInfo> diff=new LinkedHashSet<FileInfo>(clientFileSet);
    diff.removeAll(browserFileSet);
    for (    FileInfo info : diff) {
      filesToRequest.add(info);
    }
    for (    FileInfo browserFileInfo : browserFileSet) {
      for (      FileInfo clientFileInfo : clientFileSet) {
        if (clientFileInfo.equals(browserFileInfo) && clientFileInfo.getTimestamp() > browserFileInfo.getTimestamp()) {
          filesToRequest.add(clientFileInfo);
          break;
        }
      }
    }
  }
  if (!filesToRequest.isEmpty()) {
    if (browser.getBrowserInfo().getName().contains("String_Node_Str")) {
      filesToRequest.clear();
      for (      FileInfo info : clientFileSet) {
        filesToRequest.add(info);
      }
    }
    Set<FileInfo> filteredFilesToRequest=filterServeOnlyFiles(clientFileSet,filesToRequest);
    writer.write(gson.toJson(filteredFilesToRequest));
  }
  writer.flush();
}

Fixed version (ground truth):
public void checkFileSet(String fileSet,String browserId,PrintWriter writer){
  Collection<FileInfo> clientFileSet=gson.fromJson(fileSet,new TypeToken<Collection<FileInfo>>(){
  }
.getType());
  SlaveBrowser browser=capturedBrowsers.getBrowser(browserId);
  Set<FileInfo> browserFileSet=browser.getFileSet();
  Set<FileInfo> filesToRequest=new LinkedHashSet<FileInfo>();
  if (browserFileSet.isEmpty() || !clientFileSet.containsAll(browserFileSet)) {
    for (    FileInfo info : clientFileSet) {
      filesToRequest.add(info);
    }
  }
 else {
    Set<FileInfo> diff=new LinkedHashSet<FileInfo>(clientFileSet);
    diff.removeAll(browserFileSet);
    for (    FileInfo info : diff) {
      filesToRequest.add(info);
    }
    for (    FileInfo browserFileInfo : browserFileSet) {
      for (      FileInfo clientFileInfo : clientFileSet) {
        if (clientFileInfo.equals(browserFileInfo) && clientFileInfo.getTimestamp() > browserFileInfo.getTimestamp()) {
          filesToRequest.add(clientFileInfo);
          break;
        }
      }
    }
  }
  if (!filesToRequest.isEmpty()) {
    if (browser.getBrowserInfo().getName().contains("String_Node_Str") || browser.getBrowserInfo().getName().contains("String_Node_Str") || browser.getBrowserInfo().getName().contains("String_Node_Str")) {
      filesToRequest.clear();
      for (      FileInfo info : clientFileSet) {
        filesToRequest.add(info);
      }
    }
    Set<FileInfo> filteredFilesToRequest=filterServeOnlyFiles(clientFileSet,filesToRequest);
    writer.write(gson.toJson(filteredFilesToRequest));
  }
  writer.flush();
}
Program: 7092
Project: 7092
Buggy source:
public void parse(String userAgent){
  String lowerCaseUserAgent=userAgent.toLowerCase();
  if (lowerCaseUserAgent.contains("String_Node_Str")) {
    userAgentOs="String_Node_Str";
  }
 else   if (lowerCaseUserAgent.contains("String_Node_Str")) {
    userAgentOs="String_Node_Str";
  }
 else   if (lowerCaseUserAgent.contains("String_Node_Str")) {
    userAgentOs="String_Node_Str";
  }
  if (userAgent.contains("String_Node_Str")) {
    userAgentName="String_Node_Str";
    Matcher matcher=CHROME_VERSION.matcher(userAgent);
    if (matcher.find()) {
      userAgentVersion=matcher.group(1);
    }
  }
 else   if (userAgent.contains("String_Node_Str")) {
    userAgentName="String_Node_Str";
    Matcher matcher=MSIE_VERSION.matcher(userAgent);
    if (matcher.find()) {
      userAgentVersion=matcher.group(1);
    }
  }
 else {
    Matcher matcher=BROWSER_NAME_AND_VERSION.matcher(userAgent);
    if (matcher.find()) {
      userAgentName=matcher.group(1);
      userAgentVersion=matcher.group(2);
    }
  }
}

Fixed version (ground truth):
public void parse(String userAgent){
  String lowerCaseUserAgent=userAgent.toLowerCase();
  if (lowerCaseUserAgent.contains("String_Node_Str")) {
    userAgentOs="String_Node_Str";
  }
 else   if (lowerCaseUserAgent.contains("String_Node_Str")) {
    userAgentOs="String_Node_Str";
  }
 else   if (lowerCaseUserAgent.contains("String_Node_Str")) {
    userAgentOs="String_Node_Str";
  }
  if (userAgent.contains("String_Node_Str")) {
    userAgentName="String_Node_Str";
    Matcher matcher=CHROME_VERSION.matcher(userAgent);
    if (matcher.find()) {
      userAgentVersion=matcher.group(1);
    }
  }
 else   if (userAgent.contains("String_Node_Str")) {
    userAgentName="String_Node_Str";
    Matcher matcher=MSIE_VERSION.matcher(userAgent);
    if (matcher.find()) {
      userAgentVersion=matcher.group(1);
    }
  }
 else {
    Matcher matcher=BROWSER_NAME_AND_VERSION.matcher(userAgent);
    if (matcher.find()) {
      userAgentName=matcher.group(1);
      userAgentVersion=matcher.group(2);
    }
 else {
      userAgentName=userAgent;
    }
  }
}
Program: 7093
Project: 7093
Buggy source:
public void testNoBrowsers() throws Exception {
  ActionSequenceBuilder builder=new ActionSequenceBuilder(new ActionFactory(null),null);
  List<Action> actions=builder.addTests(tests(),"String_Node_Str",false,false).withLocalServerPort(999).usingFiles(files,false).build();
  List<Class<? extends Action>> expectedActions=new ArrayList<Class<? extends Action>>();
  expectedActions.add(ServerStartupAction.class);
  expectedActions.add(BrowserStartupAction.class);
  expectedActions.add(ThreadedActionsRunner.class);
  expectedActions.add(BrowserShutdownAction.class);
  expectedActions.add(ServerShutdownAction.class);
  this.<Action>assertSequence(expectedActions,actions);
}

Fixed version (ground truth):
public void testNoBrowsers() throws Exception {
  ActionSequenceBuilder builder=new ActionSequenceBuilder(new ActionFactory(null),null);
  List<Action> actions=builder.addTests(tests(),"String_Node_Str",false,false).withLocalServerPort(999).usingFiles(files,false).build();
  List<Class<? extends Action>> expectedActions=new ArrayList<Class<? extends Action>>();
  expectedActions.add(ServerStartupAction.class);
  expectedActions.add(ThreadedActionsRunner.class);
  expectedActions.add(ServerShutdownAction.class);
  this.<Action>assertSequence(expectedActions,actions);
}
Program: 7094
Project: 7094
Buggy source:
public void testUploadFiles() throws Exception {
  MockServer server=new MockServer();
  Gson gson=new Gson();
  FileInfo fileInfo=new FileInfo("String_Node_Str",1232,false);
  server.expect("String_Node_Str","String_Node_Str");
  server.expect("String_Node_Str" + gson.toJson(Arrays.asList(fileInfo)) + "String_Node_Str","String_Node_Str");
  server.expect("String_Node_Str","String_Node_Str");
  server.expect("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  Map<String,String> params=new LinkedHashMap<String,String>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  FakeResponseStream stream=new FakeResponseStream();
  MockFileReader fileReader=new MockFileReader();
  fileReader.addExpectation(fileInfo.getFileName(),"String_Node_Str");
  CommandTask task=new CommandTask(new ActionFactory.ActionFactoryFileFilter(),stream,new LinkedHashSet<FileInfo>(Arrays.asList(fileInfo)),new LinkedHashSet<String>(),"String_Node_Str",server,params,fileReader);
  task.run();
  Response response=stream.getResponse();
  assertEquals("String_Node_Str",response.getResponse());
  assertEquals("String_Node_Str",response.getBrowser().getName());
  assertEquals("String_Node_Str",response.getError());
  assertEquals(123L,response.getExecutionTime());
}

Fixed version (ground truth):
public void testUploadFiles() throws Exception {
  MockServer server=new MockServer();
  Gson gson=new Gson();
  FileInfo fileInfo=new FileInfo("String_Node_Str",1232,false,false);
  server.expect("String_Node_Str","String_Node_Str");
  server.expect("String_Node_Str" + gson.toJson(Arrays.asList(fileInfo)) + "String_Node_Str","String_Node_Str");
  server.expect("String_Node_Str","String_Node_Str");
  server.expect("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  Map<String,String> params=new LinkedHashMap<String,String>();
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  FakeResponseStream stream=new FakeResponseStream();
  MockFileReader fileReader=new MockFileReader();
  fileReader.addExpectation(fileInfo.getFileName(),"String_Node_Str");
  CommandTask task=new CommandTask(new ActionFactory.ActionFactoryFileFilter(),stream,new LinkedHashSet<FileInfo>(Arrays.asList(fileInfo)),new LinkedHashSet<String>(),"String_Node_Str",server,params,fileReader);
  task.run();
  Response response=stream.getResponse();
  assertEquals("String_Node_Str",response.getResponse());
  assertEquals("String_Node_Str",response.getBrowser().getName());
  assertEquals("String_Node_Str",response.getError());
  assertEquals(123L,response.getExecutionTime());
}
Program: 7095
Project: 7095
Buggy source:
public void testAddFilesNameAndDataToMap() throws Exception {
  CapturedBrowsers capturedBrowsers=new CapturedBrowsers();
  capturedBrowsers.addSlave(new SlaveBrowser(new MockTime(0),"String_Node_Str",new BrowserInfo()));
  Map<String,String> files=new HashMap<String,String>();
  FilesCache filesCache=new FilesCache(files);
  FileSetServlet fileSetServlet=new FileSetServlet(capturedBrowsers,filesCache);
  fileSetServlet.uploadFiles("String_Node_Str","String_Node_Str" + "String_Node_Str");
  assertEquals(2,filesCache.getFilesNumber());
  assertEquals("String_Node_Str",filesCache.getFileContent("String_Node_Str"));
  assertEquals("String_Node_Str",filesCache.getFileContent("String_Node_Str"));
}

Fixed version (ground truth):
public void testAddFilesNameAndDataToMap() throws Exception {
  CapturedBrowsers capturedBrowsers=new CapturedBrowsers();
  capturedBrowsers.addSlave(new SlaveBrowser(new MockTime(0),"String_Node_Str",new BrowserInfo()));
  Map<String,FileData> files=new HashMap<String,FileData>();
  FilesCache filesCache=new FilesCache(files);
  FileSetServlet fileSetServlet=new FileSetServlet(capturedBrowsers,filesCache);
  fileSetServlet.uploadFiles("String_Node_Str","String_Node_Str" + "String_Node_Str");
  assertEquals(2,filesCache.getFilesNumber());
  assertEquals("String_Node_Str",filesCache.getFileContent("String_Node_Str"));
  assertEquals("String_Node_Str",filesCache.getFileContent("String_Node_Str"));
}
Program: 7096
Project: 7096
Buggy source:
public void testCaptureAddFilesToLoadAndRun() throws Exception {
  Map<String,String> files=new LinkedHashMap<String,String>();
  files.put("String_Node_Str","String_Node_Str");
  files.put("String_Node_Str","String_Node_Str");
  files.put("String_Node_Str","String_Node_Str");
  files.put("String_Node_Str","String_Node_Str");
  FilesCache cache=new FilesCache(files);
  CapturedBrowsers capturedBrowsers=new CapturedBrowsers();
  StandaloneRunnerServlet runnerServlet=new StandaloneRunnerServlet(new BrowserHunter(capturedBrowsers),cache,new StandaloneRunnerFilesFilterImpl(),new SlaveResourceService("String_Node_Str"));
  runnerServlet.service("String_Node_Str","String_Node_Str","String_Node_Str");
  SlaveBrowser slaveBrowser=capturedBrowsers.getBrowser("String_Node_Str");
  assertNotNull(slaveBrowser.peekCommand());
  Command cmd=slaveBrowser.dequeueCommand();
  assertNotNull(cmd);
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",cmd.getCommand());
  assertNotNull(slaveBrowser.peekCommand());
  cmd=slaveBrowser.dequeueCommand();
  assertNotNull(cmd);
  assertEquals("String_Node_Str",cmd.getCommand());
}

Fixed version (ground truth):
public void testCaptureAddFilesToLoadAndRun() throws Exception {
  Map<String,FileData> files=new LinkedHashMap<String,FileData>();
  files.put("String_Node_Str",new FileData("String_Node_Str","String_Node_Str",30));
  files.put("String_Node_Str",new FileData("String_Node_Str","String_Node_Str",5));
  files.put("String_Node_Str",new FileData("String_Node_Str","String_Node_Str",53));
  files.put("String_Node_Str",new FileData("String_Node_Str","String_Node_Str",1));
  FilesCache cache=new FilesCache(files);
  CapturedBrowsers capturedBrowsers=new CapturedBrowsers();
  StandaloneRunnerServlet runnerServlet=new StandaloneRunnerServlet(new BrowserHunter(capturedBrowsers),cache,new StandaloneRunnerFilesFilterImpl(),new SlaveResourceService("String_Node_Str"));
  runnerServlet.service("String_Node_Str","String_Node_Str","String_Node_Str");
  SlaveBrowser slaveBrowser=capturedBrowsers.getBrowser("String_Node_Str");
  assertNotNull(slaveBrowser.peekCommand());
  Command cmd=slaveBrowser.dequeueCommand();
  assertNotNull(cmd);
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",cmd.getCommand());
  assertNotNull(slaveBrowser.peekCommand());
  cmd=slaveBrowser.dequeueCommand();
  assertNotNull(cmd);
  assertEquals("String_Node_Str",cmd.getCommand());
}
Program: 7097
Project: 7097
Buggy source:
public void testEmptyReturnWhenFileNotPresent() throws Exception {
  TestResourceServlet servlet=new TestResourceServlet(new FilesCache(new HashMap<String,String>()));
  servlet.service("String_Node_Str",writer);
  assertEquals(0,out.toString().length());
}

Fixed version (ground truth):
public void testEmptyReturnWhenFileNotPresent() throws Exception {
  TestResourceServlet servlet=new TestResourceServlet(new FilesCache(new HashMap<String,FileData>()));
  servlet.service("String_Node_Str",writer);
  assertEquals(0,out.toString().length());
}