Program: 175977
Project: 175977
Buggy source:
/** 
 * Parses and translates query into HBase filter and invokes client's method to return list of entities.
 * @param m Entity metadata
 * @param client hbase client
 * @return list of entities.
 */
private List onQuery(EntityMetadata m,Client client){
  QueryTranslator translator=new QueryTranslator();
  translator.translate(getKunderaQuery(),m,((ClientBase)client).getClientMetadata());
  List<String> columns=getTranslatedColumns(m,getKunderaQuery().getResult(),1);
  Filter filter=translator.getFilter();
  if (translator.rowList != null && !translator.rowList.isEmpty()) {
    return ((HBaseClient)client).findAll(m.getEntityClazz(),columns.toArray(new String[columns.size()]),translator.getRowList());
  }
  if (filter == null && columns != null) {
    return ((HBaseClient)client).findByRange(m.getEntityClazz(),m,translator.getStartRow(),translator.getEndRow(),columns.toArray(new String[columns.size()]),null,getKunderaQuery().getFilterClauseQueue());
  }
  if (MetadataUtils.useSecondryIndex(((ClientBase)client).getClientMetadata())) {
    if (filter == null) {
      if (translator.isRangeScan()) {
        return ((HBaseClient)client).findByRange(m.getEntityClazz(),m,translator.getStartRow(),translator.getEndRow(),columns.toArray(new String[columns.size()]),null,getKunderaQuery().getFilterClauseQueue());
      }
 else {
        return ((HBaseClient)client).findByRange(m.getEntityClazz(),m,null,null,columns.toArray(new String[columns.size()]),null,getKunderaQuery().getFilterClauseQueue());
      }
    }
 else {
      if (translator.isRangeScan()) {
        return ((HBaseClient)client).findByRange(m.getEntityClazz(),m,translator.getStartRow(),translator.getEndRow(),columns.toArray(new String[columns.size()]),filter,getKunderaQuery().getFilterClauseQueue());
      }
 else {
        return ((HBaseClient)client).findByQuery(m.getEntityClazz(),m,filter,getKunderaQuery().getFilterClauseQueue(),columns.toArray(new String[columns.size()]));
      }
    }
  }
 else {
    List results=null;
    return populateUsingLucene(m,client,results,null);
  }
}

Fixed version (ground truth):
/** 
 * Parses and translates query into HBase filter and invokes client's method to return list of entities.
 * @param m Entity metadata
 * @param client hbase client
 * @return list of entities.
 */
private List onQuery(EntityMetadata m,Client client){
  QueryTranslator translator=new QueryTranslator();
  translator.translate(getKunderaQuery(),m,((ClientBase)client).getClientMetadata());
  List<String> columns=getTranslatedColumns(m,getKunderaQuery().getResult(),1);
  Filter filter=translator.getFilter();
  if (translator.rowList != null && !translator.rowList.isEmpty()) {
    return ((HBaseClient)client).findAll(m.getEntityClazz(),columns.toArray(new String[columns.size()]),translator.getRowList());
  }
  if (!translator.isWhereQuery() && columns != null) {
    return ((HBaseClient)client).findByRange(m.getEntityClazz(),m,translator.getStartRow(),translator.getEndRow(),columns.toArray(new String[columns.size()]),null,getKunderaQuery().getFilterClauseQueue());
  }
  if (MetadataUtils.useSecondryIndex(((ClientBase)client).getClientMetadata())) {
    if (translator.isWhereQuery() && !translator.isRangeScan()) {
      return ((HBaseClient)client).findByQuery(m.getEntityClazz(),m,filter,getKunderaQuery().getFilterClauseQueue(),columns.toArray(new String[columns.size()]));
    }
 else {
      return ((HBaseClient)client).findByRange(m.getEntityClazz(),m,translator.getStartRow(),translator.getEndRow(),columns.toArray(new String[columns.size()]),filter,getKunderaQuery().getFilterClauseQueue());
    }
  }
 else {
    return populateUsingLucene(m,client,null,null);
  }
}