Skip to content

Commit

Permalink
Fix missing deduplication in constraint tracking
Browse files Browse the repository at this point in the history
Prior to this fix the same dependency state could lead to duplicate
outgoing edges which would cause an issue when the node targeted was
removed because it was deselected.
The code now uses a datastructure that will perform the de duplication
and it no longer registers entries in some code paths.

Fixes #13551
  • Loading branch information
ljacomet committed Jun 23, 2020
1 parent 11726d3 commit ce47240
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -16,9 +16,9 @@

package org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
Expand Down Expand Up @@ -439,7 +439,7 @@ private void visitDependencies(ExcludeSpec resolutionFilter, Collection<EdgeStat

private void registerActivatingConstraint(DependencyState dependencyState) {
if (potentiallyActivatedConstraints == null) {
potentiallyActivatedConstraints = ArrayListMultimap.create();
potentiallyActivatedConstraints = LinkedHashMultimap.create();
}
potentiallyActivatedConstraints.put(dependencyState.getModuleIdentifier(), dependencyState);
}
Expand Down Expand Up @@ -1170,7 +1170,7 @@ boolean isSelectedByVariantAwareResolution() {
void makePending(EdgeState edgeState) {
outgoingEdges.remove(edgeState);
edgeState.getSelector().release();
registerActivatingConstraint(edgeState.getDependencyState());
// registerActivatingConstraint(edgeState.getDependencyState());
}

ImmutableAttributes desugar(ImmutableAttributes attributes) {
Expand Down

0 comments on commit ce47240

Please sign in to comment.