Program: 80146
Project: 80146
Buggy source:
public static void testDeleteByQueryFields(DataStore<String,WebPage> store) throws Exception {
  Query<String,WebPage> query;
  WebPageDataCreator.createWebPageData(store);
  query=store.newQuery();
  query.setFields("String_Node_Str","String_Node_Str","String_Node_Str");
  assertNumResults(store.newQuery(),URLS.length);
  store.deleteByQuery(query);
  store.deleteByQuery(query);
  store.deleteByQuery(query);
  store.flush();
  assertNumResults(store.newQuery(),URLS.length);
  for (  String SORTED_URL : SORTED_URLS) {
    WebPage page=store.get(SORTED_URL);
    assertNotNull(page);
    assertNotNull(page.getUrl());
    assertEquals(page.getUrl().toString(),SORTED_URL);
    assertEquals("String_Node_Str" + "String_Node_Str",0,page.getOutlinks().size());
    assertEquals(0,page.getParsedContent().size());
    if (page.getContent() != null) {
      LOG.info("String_Node_Str" + page.getUrl().toString());
      LOG.info("String_Node_Str" + page.getContent().limit());
    }
 else {
      assertNull(page.getContent());
    }
  }
  WebPageDataCreator.createWebPageData(store);
  query=store.newQuery();
  query.setFields("String_Node_Str");
  String startKey=SORTED_URLS[NUM_KEYS];
  String endKey=SORTED_URLS[SORTED_URLS.length - NUM_KEYS];
  query.setStartKey(startKey);
  query.setEndKey(endKey);
  assertNumResults(store.newQuery(),URLS.length);
  store.deleteByQuery(query);
  store.deleteByQuery(query);
  store.deleteByQuery(query);
  assertNumResults(store.newQuery(),URLS.length);
  for (int i=0; i < URLS.length; i++) {
    store.flush();
    WebPage page=store.get(URLS[i]);
    assertNotNull(page);
    if (URLS[i].compareTo(startKey) < 0 || URLS[i].compareTo(endKey) >= 0) {
      assertWebPage(page,i);
    }
 else {
      assertNull(page.getUrl());
      assertNotNull(page.getOutlinks());
      assertNotNull(page.getParsedContent());
      assertNotNull(page.getContent());
      assertTrue(page.getOutlinks().size() > 0);
      assertTrue(page.getParsedContent().size() > 0);
    }
  }
}

Fixed version (ground truth):
public static void testDeleteByQueryFields(DataStore<String,WebPage> store) throws Exception {
  Query<String,WebPage> query;
  WebPageDataCreator.createWebPageData(store);
  query=store.newQuery();
  query.setFields("String_Node_Str","String_Node_Str","String_Node_Str");
  assertNumResults(store.newQuery(),URLS.length);
  store.deleteByQuery(query);
  store.flush();
  assertNumResults(store.newQuery(),URLS.length);
  for (  String SORTED_URL : SORTED_URLS) {
    WebPage page=store.get(SORTED_URL);
    assertNotNull(page);
    assertNotNull(page.getUrl());
    assertEquals(page.getUrl().toString(),SORTED_URL);
    assertEquals("String_Node_Str" + "String_Node_Str",0,page.getOutlinks().size());
    assertEquals(0,page.getParsedContent().size());
    if (page.getContent() != null) {
      LOG.info("String_Node_Str" + page.getUrl().toString());
      LOG.info("String_Node_Str" + page.getContent().limit());
    }
 else {
      assertNull(page.getContent());
    }
  }
  WebPageDataCreator.createWebPageData(store);
  query=store.newQuery();
  query.setFields("String_Node_Str");
  String startKey=SORTED_URLS[NUM_KEYS];
  String endKey=SORTED_URLS[SORTED_URLS.length - NUM_KEYS];
  query.setStartKey(startKey);
  query.setEndKey(endKey);
  assertNumResults(store.newQuery(),URLS.length);
  store.deleteByQuery(query);
  store.flush();
  assertNumResults(store.newQuery(),URLS.length);
  for (int i=0; i < URLS.length; i++) {
    WebPage page=store.get(URLS[i]);
    assertNotNull(page);
    if (URLS[i].compareTo(startKey) < 0 || URLS[i].compareTo(endKey) >= 0) {
      assertWebPage(page,i);
    }
 else {
      assertNull(page.getUrl());
      assertNotNull(page.getOutlinks());
      assertNotNull(page.getParsedContent());
      assertNotNull(page.getContent());
      assertTrue(page.getOutlinks().size() > 0);
      assertTrue(page.getParsedContent().size() > 0);
    }
  }
}