private void checkViews(SchemaObject sourceTable,SchemaObject newTable){
  String sourceTableName=sourceTable.getName();
  String newTableName=newTable.getName();
  Database db=sourceTable.getDatabase();
  String temp=db.getTempTableName(sourceTableName,session);
  db.renameSchemaObject(session,sourceTable,temp);
  try {
    db.renameSchemaObject(session,newTable,sourceTableName);
    checkViewsAreValid(sourceTable);
  }
  finally {
    try {
      db.renameSchemaObject(session,newTable,newTableName);
    }
  finally {
      db.renameSchemaObject(session,sourceTable,sourceTableName);
    }
  }
}

private void checkViews ( SchemaObject sourceTable , SchemaObject newTable ) { String sourceTableName = sourceTable . getName ( ) ; String newTableName = newTable . getName ( ) ; Database db = sourceTable . getDatabase ( ) ; String temp = db . getTempTableName ( sourceTableName , session ) ; db . renameSchemaObject ( session , sourceTable , temp ) ; try { db . renameSchemaObject ( session , newTable , sourceTableName ) ; checkViewsAreValid ( sourceTable ) ; } finally { try { db . renameSchemaObject ( session , newTable , newTableName ) ; } finally { db . renameSchemaObject ( session , sourceTable , sourceTableName ) ; } } }
check that all views and other dependent objects .
