private void addDependencyOnModule(@NotNull Project project, Editor editor, @NotNull Module module) {
    ReadAction.nonBlocking(() -> CircularModuleDependenciesDetector.addingDependencyFormsCircularity(myCurrentModule, module))
      .expireWhen(() -> project.isDisposed() || module.isDisposed())
      .finishOnUiThread(ModalityState.nonModal(), circularModules -> {
        if (circularModules != null && !showCircularWarning(project, circularModules, module)) return;

        CommandProcessor.getInstance().runUndoTransparentAction(() -> {
          JavaProjectModelModificationService.getInstance(project).addDependency(myCurrentModule, module, myScope, myExported);
          if (editor == null || myClasses.isEmpty()) return;

          PsiClass[] targetClasses = myClasses.stream()
            .map(SmartPsiElementPointer::getElement)
            .filter(Objects::nonNull)
            .filter(c -> ModuleUtilCore.findModuleForPsiElement(c) == module)
            .toArray(PsiClass[]::new);
          if (targetClasses.length == 0) return;

          PsiReference ref = restoreReference();
          if (ref == null) return;

          DumbService.getInstance(project).completeJustSubmittedTasks();
          new AddImportAction(project, ref, editor, targetClasses).execute();
        });
      }).submit(AppExecutorUtil.getAppExecutorService());
  }
private void addDependencyOnModule(@NotNull Project project, Editor editor, @NotNull Module module)