docs: void open() {
  
          initParams();
  
          int state = properties.getDBModified();
  
          switch (state) {
  
              case HsqlDatabaseProperties.FILES_MODIFIED :
                  deleteNewAndOldFiles();
                  restoreBackup();
                  processScript();
                  processDataFile();
                  processLog();
                  close(false);
  
                  if (cache != null) {
                      cache.open(filesReadOnly);
                  }
  
                  reopenAllTextCaches();
                  break;
  
              case HsqlDatabaseProperties.FILES_NEW :
                  try {
                      deleteBackup();
                      backupData();
                      renameNewBackup();
                      renameNewScript();
                      deleteLog();
                      properties.setDBModified(
                          HsqlDatabaseProperties.FILES_NOT_MODIFIED);
                  } catch (IOException e) {
                      database.logger.appLog.logContext(e, null);
                  }
  
              // continue as non-modified files
              // $FALL-THROUGH$
              case HsqlDatabaseProperties.FILES_NOT_MODIFIED :
  
                  /**
                   * if startup is after a SHUTDOWN SCRIPT and there are CACHED
                   * or TEXT tables, perform a checkpoint so that the .script
                   * file no longer contains CACHED or TEXT table rows.
                   */
                  processScript();
  
                  if (isAnyCacheModified()) {
                      properties.setDBModified(
                          HsqlDatabaseProperties.FILES_MODIFIED);
                      close(false);
  
                      if (cache != null) {
                          cache.open(filesReadOnly);
                      }
  
                      reopenAllTextCaches();
                  }
                  break;
          }
  
          openLog();
  
          if (!filesReadOnly) {
              properties.setDBModified(HsqlDatabaseProperties.FILES_MODIFIED);
          }
      }