Program: 154558
Project: 154558
Buggy source:
@Test public void testFulltext(){
  BatchInserter inserter=new BatchInserterImpl(PATH);
  BatchInserterIndexProvider provider=new LuceneBatchInserterIndexProvider(inserter);
  String name="String_Node_Str";
  BatchInserterIndex index=provider.nodeIndex(name,MapUtil.stringMap("String_Node_Str","String_Node_Str"));
  long id1=inserter.createNode(null);
  index.add(id1,MapUtil.map("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  long id2=inserter.createNode(null);
  index.add(id2,MapUtil.map("String_Node_Str","String_Node_Str"));
  index.flush();
  assertContains(index.get("String_Node_Str","String_Node_Str"),id1);
  assertContains(index.query("String_Node_Str","String_Node_Str"),id1);
  assertContains(index.query("String_Node_Str","String_Node_Str"));
  assertContains(index.query("String_Node_Str","String_Node_Str"),id1,id2);
  assertContains(index.query("String_Node_Str","String_Node_Str"),id1);
  assertContains(index.get("String_Node_Str","String_Node_Str"),id1);
  long id3=inserter.createNode(null);
  index.add(id3,MapUtil.map("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}));
  index.flush();
  assertContains(index.get("String_Node_Str","String_Node_Str"),id3);
  assertContains(index.get("String_Node_Str","String_Node_Str"),id3);
  provider.shutdown();
  inserter.shutdown();
  GraphDatabaseService db=new EmbeddedGraphDatabase(PATH);
  Index<Node> dbIndex=db.index().forNodes(name);
  Node node1=db.getNodeById(id1);
  Node node2=db.getNodeById(id2);
  assertContains(dbIndex.query("String_Node_Str","String_Node_Str"),node1,node2);
  db.shutdown();
}

Fixed version (ground truth):
@Test public void testFulltext(){
  BatchInserter inserter=new BatchInserterImpl(PATH);
  BatchInserterIndexProvider provider=new LuceneBatchInserterIndexProvider(inserter);
  String name="String_Node_Str";
  BatchInserterIndex index=provider.nodeIndex(name,stringMap("String_Node_Str","String_Node_Str"));
  long id1=inserter.createNode(null);
  index.add(id1,map("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  long id2=inserter.createNode(null);
  index.add(id2,map("String_Node_Str","String_Node_Str"));
  index.flush();
  assertContains(index.get("String_Node_Str","String_Node_Str"),id1);
  assertContains(index.query("String_Node_Str","String_Node_Str"),id1);
  assertContains(index.query("String_Node_Str","String_Node_Str"));
  assertContains(index.query("String_Node_Str","String_Node_Str"),id1,id2);
  assertContains(index.query("String_Node_Str","String_Node_Str"),id1);
  assertContains(index.get("String_Node_Str","String_Node_Str"),id1);
  long id3=inserter.createNode(null);
  index.add(id3,map("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}));
  index.flush();
  assertContains(index.get("String_Node_Str","String_Node_Str"),id3);
  assertContains(index.get("String_Node_Str","String_Node_Str"),id3);
  provider.shutdown();
  inserter.shutdown();
  GraphDatabaseService db=new EmbeddedGraphDatabase(PATH);
  Index<Node> dbIndex=db.index().forNodes(name);
  Node node1=db.getNodeById(id1);
  Node node2=db.getNodeById(id2);
  assertContains(dbIndex.query("String_Node_Str","String_Node_Str"),node1,node2);
  db.shutdown();
}