Sort module selectors This commit reworks module selectors so that they are sorted in an order which reduces the cost of module selection. We make sure to put local (project) selectors first, then we use selectors from locks (if any).
The next selectors are "latest" version selectors because even if they are dynamic, they are likely to "win" selection. Then, exact version selectors are sorted by version descending , and last we add dynamic version selectors.
Fix ConcurrentModificationException in NodeState When removing outgoing edges, there was a code path trying to remove elements from the same collection that is being cleared initially. This commit fixes that condition by not attempting to do so, knowing that the edges to be removed will be as part of the external iteration.