Program: 176771
Project: 176771
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()));
  Properties cFProperties=getColumnFamilyProperties(tableInfo);
  String defaultValidationClass=null;
  if (tableInfo.getType() != null && tableInfo.getType().equals(Type.COLUMN_FAMILY.name())) {
    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);
    }
  }
 else   if (tableInfo.getType() != null) {
    if (isCounterColumnType(tableInfo,defaultValidationClass)) {
      cfDef.setDefault_validation_class(CounterColumnType.class.getSimpleName());
    }
    cfDef.setColumn_type("String_Node_Str");
  }
  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.COLUMN_FAMILY.name())) {
    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);
    }
  }
 else   if (tableInfo.getType() != null) {
    if (isCounterColumnType(tableInfo,defaultValidationClass)) {
      cfDef.setDefault_validation_class(CounterColumnType.class.getSimpleName());
    }
    cfDef.setColumn_type("String_Node_Str");
  }
  setColumnFamilyProperties(cfDef,cFProperties,null);
  return cfDef;
}