Program: 6318
Project: 6318
Buggy source:
@Test public void testSearchOnValue() throws Exception {
  MetadataEntry entry=new MetadataEntry(flow1,"String_Node_Str","String_Node_Str");
  String multiWordValue="String_Node_Str";
  MetadataEntry multiWordEntry=new MetadataEntry(flow1,"String_Node_Str",multiWordValue);
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str",multiWordValue);
  List<MetadataEntry> results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  MetadataEntry result=results.get(0);
  Assert.assertEquals(entry,result);
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  result=results.get(0);
  Assert.assertEquals(multiWordEntry,result);
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  result=results.get(0);
  Assert.assertEquals(multiWordEntry,result);
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  result=results.get(0);
  Assert.assertEquals(entry,result);
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  List<MetadataEntry> results2=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(2,results2.size());
  for (  MetadataEntry result2 : results2) {
    Assert.assertEquals("String_Node_Str",result2.getValue());
  }
  dataset.setProperty(stream1,"String_Node_Str","String_Node_Str");
  List<MetadataEntry> results3=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(2,results3.size());
  for (  MetadataEntry result3 : results3) {
    Assert.assertTrue(result3.getValue().startsWith("String_Node_Str"));
  }
  List<MetadataEntry> results4=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results4.size());
}

Fixed version (ground truth):
@Test public void testSearchOnValue() throws Exception {
  MetadataEntry entry=new MetadataEntry(flow1,"String_Node_Str","String_Node_Str");
  String multiWordValue="String_Node_Str";
  MetadataEntry multiWordEntry=new MetadataEntry(flow1,"String_Node_Str",multiWordValue);
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  dataset.setProperty(flow1,"String_Node_Str",multiWordValue);
  List<MetadataEntry> results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  MetadataEntry result=results.get(0);
  Assert.assertEquals(entry,result);
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  result=results.get(0);
  Assert.assertEquals(multiWordEntry,result);
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(1,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results.size());
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  result=results.get(0);
  Assert.assertEquals(multiWordEntry,result);
  results=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(1,results.size());
  result=results.get(0);
  Assert.assertEquals(entry,result);
  dataset.setProperty(flow1,"String_Node_Str","String_Node_Str");
  List<MetadataEntry> results2=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.PROGRAM);
  Assert.assertEquals(2,results2.size());
  for (  MetadataEntry result2 : results2) {
    Assert.assertEquals("String_Node_Str",result2.getValue());
  }
  dataset.setProperty(stream1,"String_Node_Str","String_Node_Str");
  List<MetadataEntry> results3=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(2,results3.size());
  for (  MetadataEntry result3 : results3) {
    Assert.assertTrue(result3.getValue().startsWith("String_Node_Str"));
  }
  List<MetadataEntry> results4=dataset.search("String_Node_Str","String_Node_Str",MetadataSearchTargetType.ALL);
  Assert.assertEquals(0,results4.size());
}