private void setupSdk(@NotNull Sdk newJdk, @Nullable java.util.function.Consumer<? super Sdk> callback) {
    String home = newJdk.getHomePath();
    SdkType sdkType = (SdkType)newJdk.getSdkType();

    AtomicBoolean pathSetup = new AtomicBoolean(false);
    ProgressManager.getInstance()
      .runProcessWithProgressSynchronously(
        () -> { pathSetup.set(sdkType.setupSdkPaths(newJdk, this)); },
        ProjectBundle.message("progress.text.configuring.sdk"),
        true,
        null
      )
    ;
    if (!pathSetup.get()) return;

    if (newJdk.getVersionString() == null) {
      String message = ProjectBundle.message("sdk.java.corrupt.error", home);
      Messages.showMessageDialog(message, ProjectBundle.message("sdk.java.corrupt.title"), Messages.getErrorIcon());
    }

    doAdd(newJdk, callback);
  }
private void setupSdk(@NotNull Sdk newJdk, @Nullable java.util.function.Consumer<? super Sdk> callback)