private ActionContext getContextForAction(DockingActionIf action, ActionContext localContext,
			Map<Class<? extends ActionContext>, ActionContext> defaultContextMap) {

		if (action.isValidContext(localContext)) {
			return localContext;
		}
		if (action.supportsDefaultContext()) {
			ActionContext context = defaultContextMap.get(action.getContextClass());
			if (context != null && action.isValidContext(context)) {
				return context;
			}
		}
		return null;
	}
We need the guard against reentrant changes to the actionToProxyMap, lest the iterator
throw a ConcurrentModificationException. If the guard finds a violation, i.e., the map
has changed, we just bail. Whatever changed the map should also trigger an update to
context, and so we should have a fresh go here with the new map.

There are three points where there could be reentrant modifications. Those are 1) when
computing an action's context, 2) when checking if the action is enabled for that
context, and 3) when setting the proxy's enabled state. There are minimal performance
trade-offs to consider when deciding which points to check. Critically, we must check
somewhere between the last point and the end of the loop, i.e., before stepping the
iterator. We opt to check only that last point, since reentry is uncommon here.
Ghidra/Framework/Docking/src/main/java/docking/WindowActionManager.java