void () { assertNotDispatchThread(); try { if (!canInitiateNewActivity()) { throw new ProcessCanceledException(); } execute(bgBuildAction); if (edtPostRunnable != null) { builder.updateAfterLoadedInBackground(new TreeRunnable("AbstractTreeUi.queueToBackground: update after") { @Override public void perform() { try { assertIsDispatchThread(); if (!canInitiateNewActivity()) { throw new ProcessCanceledException(); } execute(edtPostRunnable); } catch (ProcessCanceledException e) { fail.set(e); cancelUpdate(); } finally { unregisterWorkerTask(bgBuildAction, finalizer); } } }); } else { unregisterWorkerTask(bgBuildAction, finalizer); } } catch (ProcessCanceledException e) { fail.set(e); unregisterWorkerTask(bgBuildAction, finalizer); cancelUpdate(); } catch (Throwable t) { unregisterWorkerTask(bgBuildAction, finalizer); throw new RuntimeException(t); } }