public void doUpdatePackages(@NotNull final PackageManagementService packageManagementService) {
    onUpdateStarted();
    ProgressManager.getInstance().run(new Task.Backgroundable(myProject,
                                                              IdeBundle.message("packages.settings.loading"),
                                                              true,
                                                              PerformInBackgroundOption.ALWAYS_BACKGROUND) {
      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        List<? extends InstalledPackage> packages = List.of();
        try {
          packages = packageManagementService.getInstalledPackagesList();
        }
        catch (ExecutionException e) {
          LOG.warn(e.getMessage()); // do nothing, we already have an empty list
        }
        finally {
          final Map<String, RepoPackage> cache = buildNameToPackageMap(packageManagementService.getAllPackagesCached());
          final boolean shouldFetchLatestVersionsForOnlyInstalledPackages = shouldFetchLatestVersionsForOnlyInstalledPackages();
          if (cache.isEmpty()) {
            if (!shouldFetchLatestVersionsForOnlyInstalledPackages) {
              refreshLatestVersions(packageManagementService);
            }
          }

          List<Object[]> rows = ContainerUtil.map(packages,
                                                  pkg -> new Object[]{
                                                    pkg,
                                                    pkg.getVersion(),
                                                    getVersionString(cache.get(pkg.getName()))
                                                  });

          UIUtil.invokeLaterIfNeeded(() -> {
            if (packageManagementService == myPackageManagementService) {
              myPackagesTableModel.getDataVector().clear();
              for (Object[] row : rows) {
                myPackagesTableModel.addRow(row);
              }
              if (!cache.isEmpty()) {
                onUpdateFinished();
              }
              if (shouldFetchLatestVersionsForOnlyInstalledPackages) {
                setLatestVersionsForInstalledPackages();
              }
            }
          });
        }
      }
    });
  }
public void doUpdatePackages(@NotNull final PackageManagementService packageManagementService)