Program: 176527
Project: 176527
Buggy source:
/** 
 * Populate data.
 * @param m the m
 * @param qResults the q results
 * @param entities the entities
 * @param isRelational the is relational
 * @param relationNames the relation names
 * @param dataHandler the data handler
 */
protected void populateData(EntityMetadata m,Map<Bytes,List<Column>> qResults,List<Object> entities,boolean isRelational,List<String> relationNames,CassandraDataHandler dataHandler){
  if (m.getType().isSuperColumnFamilyMetadata()) {
    Set<Bytes> primaryKeys=qResults.keySet();
    if (primaryKeys != null && !primaryKeys.isEmpty()) {
      Object[] rowIds=new Object[primaryKeys.size()];
      int i=0;
      for (      Bytes b : primaryKeys) {
        rowIds[i]=PropertyAccessorHelper.getObject(b,(Field)m.getIdAttribute().getJavaMember());
        i++;
      }
      entities.addAll(findAll(m.getEntityClazz(),null,rowIds));
    }
  }
 else {
    Iterator<Bytes> rowIter=qResults.keySet().iterator();
    while (rowIter.hasNext()) {
      Bytes rowKey=rowIter.next();
      List<Column> columns=qResults.get(rowKey);
      try {
        Object id=PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),rowKey.toByteArray());
        Object e=dataHandler.populateEntity(new ThriftRow(id,m.getTableName(),columns,new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0)),m,relationNames,isRelational,isCql3Enabled(m));
        if (e != null) {
          entities.add(e);
        }
      }
 catch (      IllegalStateException e) {
        throw new KunderaException(e);
      }
catch (      Exception e) {
        throw new KunderaException(e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Populate data.
 * @param m the m
 * @param qResults the q results
 * @param entities the entities
 * @param isRelational the is relational
 * @param relationNames the relation names
 * @param dataHandler the data handler
 */
protected void populateData(EntityMetadata m,Map<Bytes,List<Column>> qResults,List<Object> entities,boolean isRelational,List<String> relationNames,CassandraDataHandler dataHandler){
  if (m.getType().isSuperColumnFamilyMetadata()) {
    Set<Bytes> primaryKeys=qResults.keySet();
    if (primaryKeys != null && !primaryKeys.isEmpty()) {
      Object[] rowIds=new Object[primaryKeys.size()];
      int i=0;
      for (      Bytes b : primaryKeys) {
        rowIds[i]=PropertyAccessorHelper.getObject(b,(Field)m.getIdAttribute().getJavaMember());
        i++;
      }
      entities.addAll(findAll(m.getEntityClazz(),null,rowIds));
    }
  }
 else {
    Iterator<Bytes> rowIter=qResults.keySet().iterator();
    while (rowIter.hasNext()) {
      Bytes rowKey=rowIter.next();
      List<Column> columns=qResults.get(rowKey);
      try {
        Object id=PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),rowKey.toByteArray());
        Object e=dataHandler.populateEntity(new ThriftRow(id,m.getTableName(),columns,new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0)),m,relationNames,isRelational);
        if (e != null) {
          entities.add(e);
        }
      }
 catch (      IllegalStateException e) {
        throw new KunderaException(e);
      }
catch (      Exception e) {
        throw new KunderaException(e);
      }
    }
  }
}