Program: 11171
Project: 11171
Buggy source:
/** 
 * Transforms a Cassandra   {@link com.datastax.driver.core.ResultSet} into a {@link com.stratio.crossdata.common.data.ResultSet}.
 * @param resultSet The input Cassandra result set.
 * @param alias  The map with the relations between ColumnName and Alias.
 * @return An equivalent Meta ResultSet.
 */
public com.stratio.crossdata.common.data.ResultSet transformToMetaResultSet(com.datastax.driver.core.ResultSet resultSet,Map<Selector,String> alias){
  ResultSet crs=new ResultSet();
  CassandraMetadataHelper helper=new CassandraMetadataHelper();
  List<ColumnDefinitions.Definition> definitions=resultSet.getColumnDefinitions().asList();
  List<ColumnMetadata> columnList=new ArrayList<>();
  ColumnMetadata columnMetadata=null;
  for (  ColumnDefinitions.Definition def : definitions) {
    ColumnName columnName=new ColumnName(def.getKeyspace(),def.getTable(),def.getName());
    ColumnType type=helper.toColumnType(def.getType().getName().toString());
    ColumnName cassandraColumnName=new ColumnName(def.getKeyspace(),def.getTable(),def.getName());
    for (    Map.Entry<Selector,String> entry : alias.entrySet()) {
      if (entry.getKey().getColumnName().getQualifiedName().equals(cassandraColumnName.getQualifiedName())) {
        columnMetadata=new ColumnMetadata(columnName,null,type);
        columnMetadata.getName().setAlias(entry.getValue());
        break;
      }
 else {
        columnMetadata=new ColumnMetadata(columnName,null,type);
      }
    }
    columnList.add(columnMetadata);
  }
  crs.setColumnMetadata(columnList);
  try {
    for (    Row row : resultSet.all()) {
      com.stratio.crossdata.common.data.Row metaRow=new com.stratio.crossdata.common.data.Row();
      for (      ColumnDefinitions.Definition def : definitions) {
        if (def.getName().toLowerCase().startsWith("String_Node_Str")) {
          continue;
        }
        Cell metaCell=getCell(def.getType(),row,def.getName());
        ColumnName cassandraColumnName=new ColumnName(def.getKeyspace(),def.getTable(),def.getName());
        boolean findIt=false;
        for (        Map.Entry<Selector,String> entry : alias.entrySet()) {
          if (entry.getKey().getColumnName().getQualifiedName().equals(cassandraColumnName.getQualifiedName())) {
            metaRow.addCell(entry.getValue(),metaCell);
            findIt=true;
            break;
          }
        }
        if (!findIt) {
          metaRow.addCell(def.getName(),metaCell);
        }
      }
      crs.add(metaRow);
    }
  }
 catch (  InvocationTargetException|IllegalAccessException e) {
    LOG.error("String_Node_Str",e);
    crs=new ResultSet();
  }
  return crs;
}

Fixed version (ground truth):
/** 
 * Transforms a Cassandra   {@link com.datastax.driver.core.ResultSet} into a {@link com.stratio.crossdata.common.data.ResultSet}.
 * @param resultSet The input Cassandra result set.
 * @param alias     The map with the relations between ColumnName and Alias.
 * @return An equivalent Meta ResultSet.
 */
public com.stratio.crossdata.common.data.ResultSet transformToMetaResultSet(com.datastax.driver.core.ResultSet resultSet,Map<Selector,String> alias){
  ResultSet crs=new ResultSet();
  CassandraMetadataHelper helper=new CassandraMetadataHelper();
  List<ColumnDefinitions.Definition> definitions=resultSet.getColumnDefinitions().asList();
  List<ColumnMetadata> columnList=new ArrayList<>();
  ColumnMetadata columnMetadata=null;
  for (  ColumnDefinitions.Definition def : definitions) {
    ColumnName columnName=new ColumnName(def.getKeyspace(),def.getTable(),def.getName());
    ColumnType type=helper.toColumnType(def.getType().getName().toString());
    ColumnName cassandraColumnName=new ColumnName(def.getKeyspace(),def.getTable(),def.getName());
    for (    Map.Entry<Selector,String> entry : alias.entrySet()) {
      if (entry.getKey().getColumnName().getQualifiedName().equals(cassandraColumnName.getQualifiedName())) {
        columnMetadata=new ColumnMetadata(columnName,null,type);
        columnMetadata.getName().setAlias(entry.getValue());
        break;
      }
 else {
        columnMetadata=new ColumnMetadata(columnName,null,type);
      }
    }
    columnList.add(columnMetadata);
  }
  crs.setColumnMetadata(columnList);
  try {
    for (    Row row : resultSet.all()) {
      com.stratio.crossdata.common.data.Row metaRow=new com.stratio.crossdata.common.data.Row();
      for (      ColumnDefinitions.Definition def : definitions) {
        if (def.getName().toLowerCase().startsWith("String_Node_Str")) {
          continue;
        }
        Cell metaCell=getCell(def.getType(),row,def.getName());
        ColumnName cassandraColumnName=new ColumnName(def.getKeyspace(),def.getTable(),def.getName());
        boolean findIt=false;
        for (        Map.Entry<Selector,String> entry : alias.entrySet()) {
          if (entry.getKey().getColumnName().getQualifiedName().equals(cassandraColumnName.getQualifiedName())) {
            metaRow.addCell(entry.getValue(),metaCell);
            findIt=true;
            break;
          }
        }
        if (!findIt) {
          metaRow.addCell(def.getName(),metaCell);
        }
      }
      crs.add(metaRow);
    }
  }
 catch (  InvocationTargetException|IllegalAccessException e) {
    LOG.error("String_Node_Str",e);
    crs=new ResultSet();
  }
  return crs;
}