void (@NotNull AnActionEvent e) { Project project = e.getProject(); Pair<PlatformUpdates, InternalPluginResults> result = ProgressManager.getInstance() .run(new Task.WithResult<>(project, IdeBundle.message("find.ide.update.title"), true) { @Override protected @NotNull Pair<@NotNull PlatformUpdates, @Nullable InternalPluginResults> compute(@NotNull ProgressIndicator indicator) { PlatformUpdates platformUpdates = UpdateChecker.getPlatformUpdates(UpdateSettings.getInstance(), indicator); InternalPluginResults pluginResults = platformUpdates instanceof PlatformUpdates.Loaded ? getInternalPluginUpdates((PlatformUpdates.Loaded)platformUpdates, indicator) : null; return Pair.create(platformUpdates, pluginResults); } private static @NotNull InternalPluginResults getInternalPluginUpdates(@NotNull PlatformUpdates.Loaded loadedResult, @NotNull ProgressIndicator indicator) { return UpdateChecker.getInternalPluginUpdates(loadedResult.getNewBuild().getApiVersion(), indicator); } }); PlatformUpdates platformUpdateInfo = result.getFirst(); InternalPluginResults pluginResults = result.getSecond(); if (platformUpdateInfo instanceof PlatformUpdates.Loaded && pluginResults != null) { setPlatformUpdateInfo((PlatformUpdates.Loaded)platformUpdateInfo); newPlatformUpdate(pluginResults.getPluginUpdates().getAll(), pluginResults.getPluginNods(), null); super.actionPerformed(e); } else { if (platformUpdateInfo instanceof PlatformUpdates.ConnectionError) { String errorMessage = ((PlatformUpdates.ConnectionError)platformUpdateInfo).getError().getMessage(); Messages.showErrorDialog(project, IdeBundle.message("updates.error.connection.failed", errorMessage), IdeBundle.message("find.ide.update.title")); } else { Messages.showInfoMessage(project, IdeBundle.message("updates.no.updates.notification"), IdeBundle.message("find.ide.update.title")); newPlatformUpdate(); } } }