void () { myHandler.addProcessListener(new ProcessAdapter() { @Override public void processTerminated(final @NotNull ProcessEvent event) { final int exitCode = event.getExitCode(); OUTPUT_LOG.debug(String.format("%s %% %s terminated (%s)", getCommand(), GitTextHandler.this.hashCode(), exitCode)); try { setExitCode(exitCode); GitTextHandler.this.processTerminated(exitCode); } finally { listeners().processTerminated(exitCode); } } }); myHandler.startNotify(); }