Program: 127368
Project: 127368
Buggy source:
@Override public List<TdView> fillViews(Package pack,DatabaseMetaData dbJDBCMetadata,List<String> viewFilter,String viewPattern){
  List<TdView> viewList=new ArrayList<TdView>();
  if (dbJDBCMetadata == null) {
    return null;
  }
  Package catalogOrSchema=PackageHelper.getCatalogOrSchema(pack);
  String catalogName=null;
  String schemaPattern=null;
  String[] tableType=new String[]{TableType.VIEW.toString()};
  if (catalogOrSchema != null) {
    if (catalogOrSchema instanceof Catalog) {
      catalogName=catalogOrSchema.getName();
      if (MetadataConnectionUtils.isAS400(catalogOrSchema)) {
        return viewList;
      }
    }
 else {
      Package parentCatalog=PackageHelper.getParentPackage(catalogOrSchema);
      schemaPattern=catalogOrSchema.getName();
      catalogName=parentCatalog == null ? null : parentCatalog.getName();
    }
  }
  try {
    ResultSet tables=dbJDBCMetadata.getTables(catalogName,schemaPattern,viewPattern,tableType);
    String productName=dbJDBCMetadata.getDatabaseProductName();
    while (tables.next()) {
      String tableName=tables.getString(GetTable.TABLE_NAME.name());
      String type=tables.getString(GetTable.TABLE_TYPE.name());
      if (!isCreateElement(viewFilter,tableName)) {
        continue;
      }
      String tableOwner=null;
      if (MetadataConnectionUtils.isSybase(dbJDBCMetadata)) {
        tableOwner=tables.getString(GetTable.TABLE_SCHEM.name());
      }
      boolean flag=true;
      String tableComment=null;
      if (pack != null) {
        Connection c=ConnectionHelper.getConnection(pack);
        flag=MetadataConnectionUtils.isOracle8i(c);
      }
      if (!flag) {
        tableComment=tables.getString(GetTable.REMARKS.name());
        if (StringUtils.isBlank(tableComment)) {
          String selectRemarkOnTable=MetadataConnectionUtils.getCommonQueryStr(productName,tableName);
          if (selectRemarkOnTable != null) {
            tableComment=executeGetCommentStatement(selectRemarkOnTable,dbJDBCMetadata.getConnection());
          }
        }
      }
      TdView table=RelationalFactory.eINSTANCE.createTdView();
      table.setName(tableName);
      table.setTableType(type);
      table.setLabel(table.getName());
      if (tableOwner != null) {
        ColumnSetHelper.setTableOwner(tableOwner,table);
      }
      if (tableComment != null) {
        ColumnSetHelper.setComment(tableComment,table);
      }
      viewList.add(table);
    }
    if (isLinked()) {
      PackageHelper.addMetadataTable(ListUtils.castList(MetadataTable.class,viewList),pack);
    }
  }
 catch (  SQLException e) {
    log.error(e,e);
  }
  return viewList;
}

Fixed version (ground truth):
@Override public List<TdView> fillViews(Package pack,DatabaseMetaData dbJDBCMetadata,List<String> viewFilter,String viewPattern,String[] tableType){
  List<TdView> viewList=new ArrayList<TdView>();
  if (dbJDBCMetadata == null) {
    return null;
  }
  Package catalogOrSchema=PackageHelper.getCatalogOrSchema(pack);
  String catalogName=null;
  String schemaPattern=null;
  if (catalogOrSchema != null) {
    if (catalogOrSchema instanceof Catalog) {
      catalogName=catalogOrSchema.getName();
      if (MetadataConnectionUtils.isAS400(catalogOrSchema)) {
        return viewList;
      }
    }
 else {
      Package parentCatalog=PackageHelper.getParentPackage(catalogOrSchema);
      schemaPattern=catalogOrSchema.getName();
      catalogName=parentCatalog == null ? null : parentCatalog.getName();
    }
  }
  try {
    ResultSet tables=dbJDBCMetadata.getTables(catalogName,schemaPattern,viewPattern,tableType);
    String productName=dbJDBCMetadata.getDatabaseProductName();
    while (tables.next()) {
      String tableName=tables.getString(GetTable.TABLE_NAME.name());
      String type=tables.getString(GetTable.TABLE_TYPE.name());
      if (!isCreateElement(viewFilter,tableName)) {
        continue;
      }
      String tableOwner=null;
      if (MetadataConnectionUtils.isSybase(dbJDBCMetadata)) {
        tableOwner=tables.getString(GetTable.TABLE_SCHEM.name());
      }
      boolean flag=true;
      String tableComment=null;
      if (pack != null) {
        Connection c=ConnectionHelper.getConnection(pack);
        flag=MetadataConnectionUtils.isOracle8i(c);
      }
      if (!flag) {
        tableComment=tables.getString(GetTable.REMARKS.name());
        if (StringUtils.isBlank(tableComment)) {
          String selectRemarkOnTable=MetadataConnectionUtils.getCommonQueryStr(productName,tableName);
          if (selectRemarkOnTable != null) {
            tableComment=executeGetCommentStatement(selectRemarkOnTable,dbJDBCMetadata.getConnection());
          }
        }
      }
      TdView table=RelationalFactory.eINSTANCE.createTdView();
      table.setName(tableName);
      table.setTableType(type);
      table.setLabel(table.getName());
      if (tableOwner != null) {
        ColumnSetHelper.setTableOwner(tableOwner,table);
      }
      if (tableComment != null) {
        ColumnSetHelper.setComment(tableComment,table);
      }
      viewList.add(table);
    }
    if (isLinked()) {
      PackageHelper.addMetadataTable(ListUtils.castList(MetadataTable.class,viewList),pack);
    }
  }
 catch (  SQLException e) {
    log.error(e,e);
  }
  return viewList;
}