FutureTask<Boolean> (@NotNull PsiFile file, boolean processChangedTextOnly) { ApplicationManager.getApplication().assertReadAccessAllowed(); if (DumbService.isDumb(file.getProject())) { return emptyTask(); } List<Runnable> runnables = collectOptimizers(file); if (runnables.isEmpty()) { return emptyTask(); } List<BooleanSupplier> hints = ApplicationManager.getApplication().isDispatchThread() ? Collections.emptyList() : collectAutoImports(file); return new FutureTask<>(() -> { ThreadingAssertions.assertEventDispatchThread(); CoreCodeStyleUtil.setSequentialProcessingAllowed(false); try { for (Runnable runnable : runnables) { runnable.run(); myOptimizerNotifications.add(getNotificationInfo(runnable)); } putNotificationInfoIntoCollector(); fixAllImportsSilently(file, hints); } finally { CoreCodeStyleUtil.setSequentialProcessingAllowed(true); } }, true); }