Program: 54606
Project: 54606
Buggy source:
@Override protected void queryIndexes(QueryMessage queryMessage,MessageReplier messageReplier) throws ImplementationDbException {
  AttributeMap attributeMap=messageReplier.getAttributeMap();
  ToroConnection connection=attributeMap.attr(ToroRequestProcessor.CONNECTION).get();
  String collection=queryMessage.getCollection();
  List<ToroDocument> candidates=Lists.newArrayList();
  ToroTransaction transaction=connection.createTransaction();
  try {
    String collectionNamespace=databaseName + '.' + collection;
    Collection<? extends NamedToroIndex> indexes=transaction.getIndexes(collection);
    for (    NamedToroIndex index : indexes) {
      ObjectValue.Builder objBuider=new ObjectValue.Builder().putValue("String_Node_Str",1).putValue("String_Node_Str",index.getName()).putValue("String_Node_Str",collectionNamespace).putValue("String_Node_Str",new ObjectValue.Builder());
      ObjectValue.Builder keyBuilder=new ObjectValue.Builder();
      for (      Map.Entry<AttributeReference,Boolean> entrySet : index.getAttributes().entrySet()) {
        keyBuilder.putValue(entrySet.getKey().toString(),entrySet.getValue() ? 1 : -1);
      }
      objBuider.putValue("String_Node_Str",keyBuilder);
      candidates.add(new KVToroDocument(objBuider.build()));
    }
  }
  finally {
    transaction.close();
  }
  QueryCriteria queryCriteria=Util.translateQuery(queryMessage.getDocument());
  Collection<ToroDocument> filtrered=applyQueryCriteria(candidates,queryCriteria);
  BSONDocuments docs=new BSONDocuments(filtrered);
  messageReplier.replyMessageNoCursor(docs);
}

Fixed version (ground truth):
@Override protected void queryIndexes(QueryMessage queryMessage,MessageReplier messageReplier) throws ImplementationDbException {
  AttributeMap attributeMap=messageReplier.getAttributeMap();
  ToroConnection connection=attributeMap.attr(ToroRequestProcessor.CONNECTION).get();
  Collection<String> allCollections=connection.getCollections();
  List<ToroDocument> candidates=Lists.newArrayList();
  ToroTransaction transaction=connection.createTransaction();
  try {
    for (    String collection : allCollections) {
      String collectionNamespace=databaseName + '.' + collection;
      Collection<? extends NamedToroIndex> indexes=transaction.getIndexes(collection);
      for (      NamedToroIndex index : indexes) {
        ObjectValue.Builder objBuider=new ObjectValue.Builder().putValue("String_Node_Str",1).putValue("String_Node_Str",index.getName()).putValue("String_Node_Str",collectionNamespace).putValue("String_Node_Str",new ObjectValue.Builder());
        ObjectValue.Builder keyBuilder=new ObjectValue.Builder();
        for (        Map.Entry<AttributeReference,Boolean> entrySet : index.getAttributes().entrySet()) {
          keyBuilder.putValue(entrySet.getKey().toString(),entrySet.getValue() ? 1 : -1);
        }
        objBuider.putValue("String_Node_Str",keyBuilder);
        candidates.add(new KVToroDocument(objBuider.build()));
      }
    }
  }
  finally {
    transaction.close();
  }
  QueryCriteria queryCriteria=Util.translateQuery(queryMessage.getDocument());
  Collection<ToroDocument> filtrered=applyQueryCriteria(candidates,queryCriteria);
  BSONDocuments docs=new BSONDocuments(filtrered);
  messageReplier.replyMessageNoCursor(docs);
}