Program: 176133
Project: 176133
Buggy source:
/** 
 * Execute query and Return list of Objects.
 * @param cqlQuery
 * @param clazz
 * @param relationalField
 * @param dataHandler
 * @return
 */
public List executeQuery(String cqlQuery,Class clazz,List<String> relationalField,CassandraDataHandler dataHandler,boolean isCql3Enabled){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(clazz);
  CqlResult result=null;
  List returnedEntities=new ArrayList();
  try {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str",cqlQuery);
    }
    result=executeCQLQuery(cqlQuery,isCql3Enabled);
    if (result != null && (result.getRows() != null || result.getRowsSize() > 0)) {
      returnedEntities=new ArrayList<Object>(result.getRowsSize());
      Iterator<CqlRow> iter=result.getRowsIterator();
      while (iter.hasNext()) {
        CqlRow row=iter.next();
        Object rowKey=null;
        ThriftRow thriftRow=null;
        thriftRow=new ThriftRow(rowKey,entityMetadata.getTableName(),row.getColumns(),new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0));
        Object entity=dataHandler.populateEntity(thriftRow,entityMetadata,relationalField,relationalField != null && !relationalField.isEmpty());
        if (entity != null) {
          returnedEntities.add(entity);
        }
 else {
          returnedEntities.add(row.getColumns().get(0));
        }
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
  return returnedEntities;
}

Fixed version (ground truth):
/** 
 * Execute query and Return list of Objects.
 * @param cqlQuery
 * @param clazz
 * @param relationalField
 * @param dataHandler
 * @return
 */
public List executeQuery(String cqlQuery,Class clazz,List<String> relationalField,CassandraDataHandler dataHandler,boolean isCql3Enabled,boolean isNative){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(clazz);
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  String query=appMetadata.getQuery(cqlQuery);
  CqlResult result=null;
  List returnedEntities=new ArrayList();
  try {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str",cqlQuery);
    }
    result=executeCQLQuery(cqlQuery,isCql3Enabled);
    if (result != null && (result.getRows() != null || result.getRowsSize() > 0)) {
      returnedEntities=new ArrayList<Object>(result.getRowsSize());
      Iterator<CqlRow> iter=result.getRowsIterator();
      while (iter.hasNext()) {
        CqlRow row=iter.next();
        Object rowKey=null;
        ThriftRow thriftRow=null;
        thriftRow=new ThriftRow(rowKey,entityMetadata.getTableName(),row.getColumns(),new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0));
        Object entity=dataHandler.populateEntity(thriftRow,entityMetadata,relationalField,relationalField != null && !relationalField.isEmpty());
        if (entity != null) {
          returnedEntities.add(entity);
        }
 else         if (isNative) {
          returnedEntities.add(row.getColumns().get(0));
        }
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
  return returnedEntities;
}