Program: 90019
Project: 90019
Buggy source:
public void testCombine() throws Exception {
  Map<String,String> origins=new HashMap<String,String>(8);
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  Map<Long,File> files=new HashMap<Long,File>();
  files.put(1L,TestInfo.CRAWL_LOG_1);
  files.put(4L,TestInfo.CRAWL_LOG_4);
  Set<Long> requiredSet=new HashSet<Long>();
  requiredSet.add(1L);
  requiredSet.add(4L);
  DedupCrawlLogIndexCache cache=new DedupCrawlLogIndexCache();
  File resultFile=cache.getCacheFile(files.keySet());
  setDummyCDXCache(cache);
  cache.combine(files,requiredSet);
  assertTrue("String_Node_Str",resultFile.length() > 0);
  assertFalse("String_Node_Str",new File(resultFile.getAbsolutePath().substring(0,resultFile.getAbsolutePath().length() - 4)).exists());
  File unzipDir=new File(TestInfo.WORKING_DIR,"String_Node_Str");
  unzipDir.mkdir();
  File[] resultFiles=resultFile.listFiles();
  for (  File f : resultFiles) {
    if (f.getName().endsWith("String_Node_Str")) {
      InputStream in=new GZIPInputStream(new FileInputStream(f));
      FileUtils.writeStreamToFile(in,new File(unzipDir,f.getName().substring(0,f.getName().length() - "String_Node_Str".length())));
      in.close();
    }
  }
  String indexName=unzipDir.getAbsolutePath();
  IndexSearcher index=new IndexSearcher(indexName);
  QueryParser queryParser=new QueryParser("String_Node_Str",new WhitespaceAnalyzer());
  Query q=queryParser.parse("String_Node_Str");
  Hits hits=index.search(q);
  for (int i=0; i < hits.length(); i++) {
    Document doc=hits.doc(i);
    String url=doc.get("String_Node_Str");
    String origin=doc.get("String_Node_Str");
    assertEquals("String_Node_Str" + url,origins.get(url),origin);
    origins.remove(url);
  }
  assertTrue("String_Node_Str" + origins,origins.isEmpty());
}

Fixed version (ground truth):
public void testCombine() throws Exception {
  Map<String,String> origins=new HashMap<String,String>(8);
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  origins.put("String_Node_Str","String_Node_Str");
  Map<Long,File> files=new HashMap<Long,File>();
  files.put(1L,TestInfo.CRAWL_LOG_1);
  files.put(4L,TestInfo.CRAWL_LOG_4);
  Set<Long> requiredSet=new HashSet<Long>();
  requiredSet.add(1L);
  requiredSet.add(4L);
  DedupCrawlLogIndexCache cache=new DedupCrawlLogIndexCache();
  File resultFile=cache.getCacheFile(files.keySet());
  setDummyCDXCache(cache);
  cache.combine(files);
  assertTrue("String_Node_Str",resultFile.length() > 0);
  assertFalse("String_Node_Str",new File(resultFile.getAbsolutePath().substring(0,resultFile.getAbsolutePath().length() - 4)).exists());
  File unzipDir=new File(TestInfo.WORKING_DIR,"String_Node_Str");
  unzipDir.mkdir();
  File[] resultFiles=resultFile.listFiles();
  for (  File f : resultFiles) {
    if (f.getName().endsWith("String_Node_Str")) {
      InputStream in=new GZIPInputStream(new FileInputStream(f));
      FileUtils.writeStreamToFile(in,new File(unzipDir,f.getName().substring(0,f.getName().length() - "String_Node_Str".length())));
      in.close();
    }
  }
  String indexName=unzipDir.getAbsolutePath();
  IndexSearcher index=new IndexSearcher(indexName);
  QueryParser queryParser=new QueryParser("String_Node_Str",new WhitespaceAnalyzer());
  Query q=queryParser.parse("String_Node_Str");
  Hits hits=index.search(q);
  for (int i=0; i < hits.length(); i++) {
    Document doc=hits.doc(i);
    String url=doc.get("String_Node_Str");
    String origin=doc.get("String_Node_Str");
    assertEquals("String_Node_Str" + url,origins.get(url),origin);
    origins.remove(url);
  }
  assertTrue("String_Node_Str" + origins,origins.isEmpty());
}