Source:
<code>protected void computeChildren(final ChildObserver<MultiBranchProject<?,?>> observer, final TaskListener listener) throws IOException, InterruptedException { long start = System.currentTimeMillis(); listener.getLogger().format("[%tc] Starting organization scan...%n", start); try { listener.getLogger().format("[%tc] Updating actions...%n", System.currentTimeMillis()); Map<Class<? extends Action>, Action> persistentActions = new HashMap<>(); for (ListIterator<SCMNavigator> iterator = navigators.listIterator(navigators.size()); iterator.hasPrevious(); ) { SCMNavigator navigator = iterator.previous(); persistentActions.putAll(navigator.fetchActions(this, listener)); } if (!persistentActions.isEmpty()) { BulkChange bc = new BulkChange(this); try { for (Map.Entry<Class<? extends Action>, Action> entry : persistentActions.entrySet()) { if (entry.getValue() == null) { removeActions(entry.getKey()); } else { replaceActions(entry.getKey(), entry.getValue()); } } bc.commit(); } finally { bc.abort(); } } for (SCMNavigator navigator : navigators) { if (Thread.interrupted()) { <START> throw new InterruptedException(); <END> } listener.getLogger().format("[%tc] Consulting %s%n", System.currentTimeMillis(), navigator.getDescriptor().getDisplayName()); navigator.visitSources(new SCMSourceObserverImpl(listener, observer)); } } finally { long end = System.currentTimeMillis(); listener.getLogger().format("[%tc] Finished organization scan. Scan took %s%n", end, Util.getTimeSpanString(end - start)); } }</code><technical_language>I thought introduced a utility method for this purpose in upstream PR</technical_language>

Target:
protected void computeChildren(final ChildObserver<MultiBranchProject<?,?>> observer, final TaskListener listener) throws IOException, InterruptedException { long start = System.currentTimeMillis(); listener.getLogger().format("[%tc] Starting organization scan...%n", start); try { listener.getLogger().format("[%tc] Updating actions...%n", System.currentTimeMillis()); Map<SCMNavigator, List<Action>> navigatorActions = new HashMap<>(); for (SCMNavigator navigator : navigators) { List<Action> actions; try { actions = navigator.fetchActions(this, null, listener); } catch (IOException e) { e.printStackTrace(listener.error("Could not refresh actions for navigator")); actions = Util.fixNull(state.getActions().get(navigator)); } navigatorActions.put(navigator, actions); } if (!navigatorActions.equals(state.getActions())) { boolean saveProject = false; for (List<Action> actions : navigatorActions.values()) { for (Action a : actions) { saveProject = removeActions(a.getClass()) || saveProject; } } BulkChange bc = new BulkChange(state); try { state.setActions(navigatorActions); bc.commit(); if (saveProject) { save(); } } finally { bc.abort(); } } for (SCMNavigator navigator : navigators) { if (Thread.interrupted()) { throw new InterruptedException(); } listener.getLogger().format("[%tc] Consulting %s%n", System.currentTimeMillis(), navigator.getDescriptor().getDisplayName()); navigator.visitSources(new SCMSourceObserverImpl(listener, observer)); } } finally { long end = System.currentTimeMillis(); listener.getLogger().format("[%tc] Finished organization scan. Scan took %s%n", end, Util.getTimeSpanString(end - start)); } }