void (int exitCode) { if (myModality != ModalityState.nonModal()) { ProgressManager.getInstance().runProcess(() -> super.onOSProcessTerminated(exitCode), new EmptyProgressIndicator(myModality)); } else { super.onOSProcessTerminated(exitCode); } }