Program: 176661
Project: 176661
Buggy source:
/** 
 * @param tableInfo
 * @return CfDef object
 */
private CfDef getTableMetadata(TableInfo tableInfo){
  CfDef cfDef=new CfDef();
  cfDef.setKeyspace(databaseName);
  cfDef.setName(tableInfo.getTableName());
  cfDef.setKey_validation_class(CassandraValidationClassMapper.getValidationClass(tableInfo.getTableIdType()));
  Schema schema=CassandraPropertyReader.csmd.getSchema(databaseName);
  tables=schema != null ? schema.getTables() : null;
  Properties cFProperties=getColumnFamilyProperties(tableInfo);
  String defaultValidationClass=null;
  if (tableInfo.getType() != null && tableInfo.getType().equals(Type.SUPER_COLUMN_FAMILY.name())) {
    if (isCounterColumnType(tableInfo,defaultValidationClass)) {
      cfDef.setDefault_validation_class(CounterColumnType.class.getSimpleName());
    }
    cfDef.setColumn_type("String_Node_Str");
  }
 else   if (tableInfo.getType() != null) {
    defaultValidationClass=cFProperties != null ? cFProperties.getProperty(CassandraConstants.DEFAULT_VALIDATION_CLASS) : null;
    cfDef.setColumn_type("String_Node_Str");
    if (isCounterColumnType(tableInfo,defaultValidationClass)) {
      cfDef.setDefault_validation_class(CounterColumnType.class.getSimpleName());
    }
 else {
      List<ColumnDef> columnDefs=new ArrayList<ColumnDef>();
      List<ColumnInfo> columnInfos=tableInfo.getColumnMetadatas();
      if (columnInfos != null) {
        for (        ColumnInfo columnInfo : columnInfos) {
          ColumnDef columnDef=new ColumnDef();
          if (columnInfo.isIndexable()) {
            columnDef.setIndex_type(CassandraIndexHelper.getIndexType(columnInfo.getIndexType()));
          }
          columnDef.setName(columnInfo.getColumnName().getBytes());
          columnDef.setValidation_class(CassandraValidationClassMapper.getValidationClass(columnInfo.getType()));
          columnDefs.add(columnDef);
        }
      }
      cfDef.setColumn_metadata(columnDefs);
    }
  }
  setColumnFamilyProperties(cfDef,cFProperties,null);
  return cfDef;
}

Fixed version (ground truth):
/** 
 * @param tableInfo
 * @return CfDef object
 */
private CfDef getTableMetadata(TableInfo tableInfo){
  CfDef cfDef=new CfDef();
  cfDef.setKeyspace(databaseName);
  cfDef.setName(tableInfo.getTableName());
  cfDef.setKey_validation_class(CassandraValidationClassMapper.getValidationClass(tableInfo.getTableIdType()));
  Schema schema=CassandraPropertyReader.csmd.getSchema(databaseName);
  tables=schema != null ? schema.getTables() : null;
  Properties cFProperties=getColumnFamilyProperties(tableInfo);
  String defaultValidationClass=null;
  if (tableInfo.getType() != null && tableInfo.getType().equals(Type.SUPER_COLUMN_FAMILY.name())) {
    if (isCounterColumnType(tableInfo,defaultValidationClass)) {
      cfDef.setDefault_validation_class(CounterColumnType.class.getSimpleName());
    }
    cfDef.setColumn_type("String_Node_Str");
    cfDef.setComparator_type(UTF8Type.class.getSimpleName());
    cfDef.setSubcomparator_type(UTF8Type.class.getSimpleName());
  }
 else   if (tableInfo.getType() != null) {
    defaultValidationClass=cFProperties != null ? cFProperties.getProperty(CassandraConstants.DEFAULT_VALIDATION_CLASS) : null;
    cfDef.setColumn_type("String_Node_Str");
    cfDef.setComparator_type(UTF8Type.class.getSimpleName());
    if (isCounterColumnType(tableInfo,defaultValidationClass)) {
      cfDef.setDefault_validation_class(CounterColumnType.class.getSimpleName());
    }
 else {
      List<ColumnDef> columnDefs=new ArrayList<ColumnDef>();
      List<ColumnInfo> columnInfos=tableInfo.getColumnMetadatas();
      if (columnInfos != null) {
        for (        ColumnInfo columnInfo : columnInfos) {
          ColumnDef columnDef=new ColumnDef();
          if (columnInfo.isIndexable()) {
            columnDef.setIndex_type(CassandraIndexHelper.getIndexType(columnInfo.getIndexType()));
          }
          columnDef.setName(columnInfo.getColumnName().getBytes());
          columnDef.setValidation_class(CassandraValidationClassMapper.getValidationClass(columnInfo.getType()));
          columnDefs.add(columnDef);
        }
      }
      cfDef.setColumn_metadata(columnDefs);
    }
  }
  setColumnFamilyProperties(cfDef,cFProperties,null);
  return cfDef;
}