Program: 176654
Project: 176654
Buggy source:
@Override protected List<Object> populateEntities(EntityMetadata m,Client client){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  List<Object> result=null;
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  if (!appMetadata.isNative(getJPAQuery()) && metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType())) {
    result=onQueryOverCompositeColumns(m,client,metaModel,null);
  }
 else {
    if (appMetadata.isNative(getJPAQuery())) {
      result=((CassandraClientBase)client).executeQuery(appMetadata.getQuery(getJPAQuery()),m.getEntityClazz(),null);
    }
 else {
      if (MetadataUtils.useSecondryIndex(m.getPersistenceUnit())) {
        boolean useInvertedIndex=CassandraIndexHelper.isInvertedIndexingApplicable(m);
        Map<Boolean,List<IndexClause>> ixClause=prepareIndexClause(m,useInvertedIndex);
        if (useInvertedIndex && !getKunderaQuery().getFilterClauseQueue().isEmpty()) {
          result=(List)((CassandraEntityReader)getReader()).readFromIndexTable(m,client,ixClause);
        }
 else {
          boolean isRowKeyQuery=ixClause.keySet().iterator().next();
          if (!isRowKeyQuery) {
            result=((CassandraClientBase)client).find(ixClause.get(isRowKeyQuery),m,false,null,maxResult,getColumnList(m,getKunderaQuery().getResult(),null));
          }
 else {
            result=((CassandraEntityReader)getReader()).handleFindByRange(m,client,result,ixClause,isRowKeyQuery,getColumnList(m,getKunderaQuery().getResult(),null));
          }
        }
      }
 else {
        result=populateUsingLucene(m,client,result);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
@Override protected List<Object> populateEntities(EntityMetadata m,Client client){
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  List<Object> result=new ArrayList<Object>();
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  if (!appMetadata.isNative(getJPAQuery()) && metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType())) {
    result=onQueryOverCompositeColumns(m,client,metaModel,null);
  }
 else {
    if (appMetadata.isNative(getJPAQuery())) {
      result=((CassandraClientBase)client).executeQuery(appMetadata.getQuery(getJPAQuery()),m.getEntityClazz(),null);
    }
 else {
      if (MetadataUtils.useSecondryIndex(m.getPersistenceUnit())) {
        boolean useInvertedIndex=CassandraIndexHelper.isInvertedIndexingApplicable(m);
        Map<Boolean,List<IndexClause>> ixClause=prepareIndexClause(m,useInvertedIndex);
        if (useInvertedIndex && !getKunderaQuery().getFilterClauseQueue().isEmpty()) {
          result=(List)((CassandraEntityReader)getReader()).readFromIndexTable(m,client,ixClause);
        }
 else {
          boolean isRowKeyQuery=ixClause.keySet().iterator().next();
          if (!isRowKeyQuery) {
            result=((CassandraClientBase)client).find(ixClause.get(isRowKeyQuery),m,false,null,maxResult,getColumnList(m,getKunderaQuery().getResult(),null));
          }
 else {
            result=((CassandraEntityReader)getReader()).handleFindByRange(m,client,result,ixClause,isRowKeyQuery,getColumnList(m,getKunderaQuery().getResult(),null));
          }
        }
      }
 else {
        result=populateUsingLucene(m,client,result);
      }
    }
  }
  return result;
}