Program: 176533
Project: 176533
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){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(clazz);
  CqlResult result=null;
  List returnedEntities=new ArrayList();
  try {
    MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(entityMetadata.getPersistenceUnit());
    if (log.isDebugEnabled()) {
      log.info("String_Node_Str" + cqlQuery);
    }
    result=executeCQLQuery(cqlQuery);
    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(),isCql3Enabled(entityMetadata));
        if (entity != null) {
          returnedEntities.add(entity);
        }
 else {
          returnedEntities.add(row.getColumns().get(0));
        }
      }
    }
  }
 catch (  InvalidRequestException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  SchemaDisagreementException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  TException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
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){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(clazz);
  CqlResult result=null;
  List returnedEntities=new ArrayList();
  try {
    MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(entityMetadata.getPersistenceUnit());
    if (log.isDebugEnabled()) {
      log.info("String_Node_Str" + cqlQuery);
    }
    result=executeCQLQuery(cqlQuery);
    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 (  InvalidRequestException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  SchemaDisagreementException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  TException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  Exception e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
  return returnedEntities;
}