Program: 176151
Project: 176151
Buggy source:
@Override public List<Object> findByRelation(String colName,Object colValue,Class entityClazz){
  EntityMetadata m=KunderaMetadataManager.getEntityMetadata(entityClazz);
  List<Object> entities=null;
  if (isCql3Enabled(m)) {
    entities=findByRelationQuery(m,colName,colValue,entityClazz,dataHandler);
  }
 else {
    SlicePredicate slicePredicate=new SlicePredicate();
    slicePredicate.setSlice_range(new SliceRange(Bytes.EMPTY.getBytes(),Bytes.EMPTY.getBytes(),false,Integer.MAX_VALUE));
    IndexExpression ie=new IndexExpression(Bytes.fromUTF8(colName).getBytes(),IndexOperator.EQ,ByteBuffer.wrap(PropertyAccessorHelper.getBytes(colValue)));
    List<IndexExpression> expressions=new ArrayList<IndexExpression>();
    expressions.add(ie);
    IndexClause ix=new IndexClause();
    ix.setStart_key(Bytes.EMPTY.toByteArray());
    ix.setCount(Integer.MAX_VALUE);
    ix.setExpressions(expressions);
    ColumnParent columnParent=new ColumnParent(m.getTableName());
    List<KeySlice> keySlices;
    Connection conn=null;
    try {
      conn=getConection();
      keySlices=conn.getClient().get_indexed_slices(columnParent,ix,slicePredicate,getConsistencyLevel());
    }
 catch (    InvalidRequestException e) {
      if (e.why != null && e.why.contains("String_Node_Str")) {
        return entities;
      }
 else {
        log.error("String_Node_Str",m.getTableName(),e);
        throw new KunderaException(e);
      }
    }
catch (    UnavailableException e) {
      log.error("String_Node_Str",m.getTableName(),e);
      throw new KunderaException(e);
    }
catch (    TimedOutException e) {
      log.error("String_Node_Str",m.getTableName(),e);
      throw new KunderaException(e);
    }
catch (    TException e) {
      log.error("String_Node_Str",m.getTableName(),e);
      throw new KunderaException(e);
    }
 finally {
      releaseConnection(conn);
    }
    if (keySlices != null) {
      entities=new ArrayList<Object>(keySlices.size());
      MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
      EntityType entityType=metaModel.entity(m.getEntityClazz());
      List<AbstractManagedType> subManagedType=((AbstractManagedType)entityType).getSubManagedType();
      if (subManagedType.isEmpty()) {
        populateData(m,keySlices,entities,m.getRelationNames() != null,m.getRelationNames());
      }
 else {
        for (        AbstractManagedType subEntity : subManagedType) {
          EntityMetadata subEntityMetadata=KunderaMetadataManager.getEntityMetadata(subEntity.getJavaType());
          populateData(subEntityMetadata,keySlices,entities,subEntityMetadata.getRelationNames() != null,subEntityMetadata.getRelationNames());
        }
      }
    }
  }
  return entities;
}

Fixed version (ground truth):
@Override public List<Object> findByRelation(String colName,Object colValue,Class entityClazz){
  EntityMetadata m=KunderaMetadataManager.getEntityMetadata(entityClazz);
  List<Object> entities=null;
  if (isCql3Enabled(m)) {
    entities=findByRelationQuery(m,colName,colValue,entityClazz,dataHandler);
  }
 else {
    SlicePredicate slicePredicate=new SlicePredicate();
    slicePredicate.setSlice_range(new SliceRange(Bytes.EMPTY.getBytes(),Bytes.EMPTY.getBytes(),false,Integer.MAX_VALUE));
    IndexExpression ie=new IndexExpression(Bytes.fromUTF8(colName).getBytes(),IndexOperator.EQ,ByteBuffer.wrap(PropertyAccessorHelper.getBytes(colValue)));
    List<IndexExpression> expressions=new ArrayList<IndexExpression>();
    expressions.add(ie);
    IndexClause ix=new IndexClause();
    ix.setStart_key(Bytes.EMPTY.toByteArray());
    ix.setCount(Integer.MAX_VALUE);
    ix.setExpressions(expressions);
    ColumnParent columnParent=new ColumnParent(m.getTableName());
    List<KeySlice> keySlices;
    Connection conn=null;
    try {
      conn=getConection();
      keySlices=conn.getClient().get_indexed_slices(columnParent,ix,slicePredicate,getConsistencyLevel());
    }
 catch (    InvalidRequestException e) {
      if (e.why != null && e.why.contains("String_Node_Str")) {
        return entities;
      }
 else {
        log.error("String_Node_Str",m.getTableName(),e);
        throw new KunderaException(e);
      }
    }
catch (    UnavailableException e) {
      log.error("String_Node_Str",m.getTableName(),e);
      throw new KunderaException(e);
    }
catch (    TimedOutException e) {
      log.error("String_Node_Str",m.getTableName(),e);
      throw new KunderaException(e);
    }
catch (    TException e) {
      log.error("String_Node_Str",m.getTableName(),e);
      throw new KunderaException(e);
    }
 finally {
      releaseConnection(conn);
    }
    if (keySlices != null) {
      entities=new ArrayList<Object>(keySlices.size());
      MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
      EntityType entityType=metaModel.entity(m.getEntityClazz());
      List<AbstractManagedType> subManagedType=((AbstractManagedType)entityType).getSubManagedType();
      if (subManagedType.isEmpty()) {
        entities=populateData(m,keySlices,entities,m.getRelationNames() != null,m.getRelationNames());
      }
 else {
        for (        AbstractManagedType subEntity : subManagedType) {
          EntityMetadata subEntityMetadata=KunderaMetadataManager.getEntityMetadata(subEntity.getJavaType());
          entities=populateData(subEntityMetadata,keySlices,entities,subEntityMetadata.getRelationNames() != null,subEntityMetadata.getRelationNames());
        }
      }
    }
  }
  return entities;
}