private @Nullable Project openProject(@NotNull Path projectPath, @NotNull Disposable parentDisposable)
    throws InterruptedException, ExecutionException {
    VirtualFile vfsProject = LocalFileSystem.getInstance().refreshAndFindFileByPath(
      FileUtil.toSystemIndependentName(projectPath.toString()));
    if (vfsProject == null) {
      reportError(InspectionsBundle.message("inspection.application.file.cannot.be.found", projectPath));
      printHelpAndExit();
    }

    reportMessageNoLineBreak(1, InspectionsBundle.message("inspection.application.opening.project"));
    ConversionService conversionService = ConversionService.getInstance();
    StringBuilder convertErrorBuffer = new StringBuilder();
    if (conversionService != null &&
        conversionService.blockingConvertSilently(projectPath, createConversionListener(convertErrorBuffer)).openingIsCanceled()) {
      onFailure(convertErrorBuffer.toString());
      return null;
    }

    for (CommandLineInspectionProjectConfigurator configurator : CommandLineInspectionProjectConfigurator.EP_NAME.getExtensionList()) {
      CommandLineInspectionProjectConfigurator.ConfiguratorContext context = configuratorContext(projectPath, null);
      if (configurator.isApplicable(context)) {
        configurator.configureEnvironment(context);
      }
    }

    if (Boolean.getBoolean("log.project.structure.changes")) {
      InspectionsReportConverter reportConverter = ReportConverterUtil.getReportConverter(myOutputFormat);
      if (reportConverter != null) {
        addRootChangesListener(parentDisposable, reportConverter);
      }
    }

    AtomicReference<Project> projectRef = new AtomicReference<>();
    ProgressManager.getInstance().runProcess(
      () -> projectRef.set(ProjectUtil.openOrImport(projectPath)),
      createProgressIndicator()
    );
    Project project = projectRef.get();
    if (project == null) {
      onFailure(InspectionsBundle.message("inspection.application.unable.open.project"));
      return null;
    }
    waitAllStartupActivitiesPassed(project);

    MessageBusConnection connection = project.getMessageBus().connect();
    connection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, () -> isMappingLoaded.setResult(null));
    Disposer.register(parentDisposable, () -> closeProject(project));

    ApplicationManager.getApplication().invokeAndWait(() -> VirtualFileManager.getInstance().refreshWithoutFileWatcher(false));

    reportMessage(1, InspectionsBundle.message("inspection.done"));
    return project;
  }
private @Nullable Project openProject(@NotNull Path projectPath, @NotNull Disposable parentDisposable)