Class ConflictResolver.State
- java.lang.Object
-
- org.eclipse.aether.util.graph.transformer.ConflictResolver.State
-
- Enclosing class:
- ConflictResolver
final class ConflictResolver.State extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ConflictResolver.ConflictContextconflictCtxThe conflict context passed to the version/scope/optionality selectors, updated as we move along rather than recreated to avoid tmp objects.(package private) java.util.Map<?,?>conflictIdsThe output from the conflict marker(package private) java.lang.ObjectcurrentIdThe conflict id currently processed.(package private) java.util.Map<java.util.List<DependencyNode>,ConflictResolver.NodeInfo>infosThe (conceptual) mapping from nodes to extra infos, technically keyed by the node's child list which better captures the identity of a node since we're basically concerned with effects towards children.(package private) java.util.List<ConflictResolver.ConflictItem>itemsThe conflict items we have gathered so far for the current conflict id.(package private) ConflictResolver.OptionalitySelectoroptionalitySelectorThe effective optionality selector, i.e.(package private) java.util.List<ConflictResolver.NodeInfo>parentInfosThe stack of node infos for parent nodes, may containnullwhich is used to disable creating new conflict items when visiting their parent again (conflict items are meant to be unique by parent-node combo).(package private) java.util.List<DependencyNode>parentNodesThe stack of parent nodes.(package private) java.util.List<java.lang.Boolean>parentOptionalsThe stack of derived optional flags for parent nodes.(package private) java.util.List<java.lang.String>parentScopesThe stack of derived scopes for parent nodes.(package private) java.util.Collection<java.lang.Object>potentialAncestorIdsThe set of conflict ids which could apply to ancestors of nodes with the current conflict id, used to avoid recursion early on.(package private) java.util.Map<java.lang.Object,DependencyNode>resolvedIdsA mapping from conflict id to winner node, helps to recognize nodes that have their effective scope&optionality set or are leftovers from previous removals.(package private) ConflictResolver.ScopeContextscopeCtxThe scope context passed to the scope deriver, updated as we move along rather than recreated to avoid tmp objects.(package private) ConflictResolver.ScopeDeriverscopeDeriverThe effective scope deriver, i.e.(package private) ConflictResolver.ScopeSelectorscopeSelectorThe effective scope selector, i.e.(package private) java.util.Map<java.util.List<DependencyNode>,java.lang.Object>stackThe set of nodes on the DFS stack to detect cycles, technically keyed by the node's child list to match the dirty graph structure produced by the dependency collector for cycles.(package private) inttotalConflictItemsStats counter.(package private) booleanverboseFlag whether we should keep losers in the graph to enable visualization/troubleshooting of conflicts.(package private) ConflictResolver.VersionSelectorversionSelectorThe effective version selector, i.e.
-
Constructor Summary
Constructors Constructor Description State(DependencyNode root, java.util.Map<?,?> conflictIds, int conflictIdCount, DependencyGraphTransformationContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidadd(DependencyNode node)private intdepth()private booleanderiveOptional(DependencyNode node, java.lang.Object conflictId)private java.lang.StringderiveScope(DependencyNode node, java.lang.Object conflictId)(package private) voidfinish()(package private) booleanloser(DependencyNode node, java.lang.Object conflictId)private ConflictResolver.ConflictItemnewConflictItem(DependencyNode parent, DependencyNode node)private DependencyNodeparent()(package private) voidpop()(package private) voidprepare(java.lang.Object conflictId, java.util.Collection<java.lang.Object> cyclicPredecessors)(package private) booleanpush(DependencyNode node, java.lang.Object conflictId)private java.lang.Stringscope(Dependency dependency)private voidscopes(int parent, Dependency child)(package private) voidwinner()
-
-
-
Field Detail
-
currentId
java.lang.Object currentId
The conflict id currently processed.
-
totalConflictItems
int totalConflictItems
Stats counter.
-
verbose
final boolean verbose
Flag whether we should keep losers in the graph to enable visualization/troubleshooting of conflicts.
-
resolvedIds
final java.util.Map<java.lang.Object,DependencyNode> resolvedIds
A mapping from conflict id to winner node, helps to recognize nodes that have their effective scope&optionality set or are leftovers from previous removals.
-
potentialAncestorIds
final java.util.Collection<java.lang.Object> potentialAncestorIds
The set of conflict ids which could apply to ancestors of nodes with the current conflict id, used to avoid recursion early on. This is basically a superset of the key set of resolvedIds, the additional ids account for cyclic dependencies.
-
conflictIds
final java.util.Map<?,?> conflictIds
The output from the conflict marker
-
items
final java.util.List<ConflictResolver.ConflictItem> items
The conflict items we have gathered so far for the current conflict id.
-
infos
final java.util.Map<java.util.List<DependencyNode>,ConflictResolver.NodeInfo> infos
The (conceptual) mapping from nodes to extra infos, technically keyed by the node's child list which better captures the identity of a node since we're basically concerned with effects towards children.
-
stack
final java.util.Map<java.util.List<DependencyNode>,java.lang.Object> stack
The set of nodes on the DFS stack to detect cycles, technically keyed by the node's child list to match the dirty graph structure produced by the dependency collector for cycles.
-
parentNodes
final java.util.List<DependencyNode> parentNodes
The stack of parent nodes.
-
parentScopes
final java.util.List<java.lang.String> parentScopes
The stack of derived scopes for parent nodes.
-
parentOptionals
final java.util.List<java.lang.Boolean> parentOptionals
The stack of derived optional flags for parent nodes.
-
parentInfos
final java.util.List<ConflictResolver.NodeInfo> parentInfos
The stack of node infos for parent nodes, may containnullwhich is used to disable creating new conflict items when visiting their parent again (conflict items are meant to be unique by parent-node combo).
-
conflictCtx
final ConflictResolver.ConflictContext conflictCtx
The conflict context passed to the version/scope/optionality selectors, updated as we move along rather than recreated to avoid tmp objects.
-
scopeCtx
final ConflictResolver.ScopeContext scopeCtx
The scope context passed to the scope deriver, updated as we move along rather than recreated to avoid tmp objects.
-
versionSelector
final ConflictResolver.VersionSelector versionSelector
The effective version selector, i.e. after initialization.
-
scopeSelector
final ConflictResolver.ScopeSelector scopeSelector
The effective scope selector, i.e. after initialization.
-
scopeDeriver
final ConflictResolver.ScopeDeriver scopeDeriver
The effective scope deriver, i.e. after initialization.
-
optionalitySelector
final ConflictResolver.OptionalitySelector optionalitySelector
The effective optionality selector, i.e. after initialization.
-
-
Constructor Detail
-
State
State(DependencyNode root, java.util.Map<?,?> conflictIds, int conflictIdCount, DependencyGraphTransformationContext context) throws RepositoryException
- Throws:
RepositoryException
-
-
Method Detail
-
prepare
void prepare(java.lang.Object conflictId, java.util.Collection<java.lang.Object> cyclicPredecessors)
-
finish
void finish()
-
winner
void winner()
-
loser
boolean loser(DependencyNode node, java.lang.Object conflictId)
-
push
boolean push(DependencyNode node, java.lang.Object conflictId) throws RepositoryException
- Throws:
RepositoryException
-
pop
void pop()
-
add
void add(DependencyNode node) throws RepositoryException
- Throws:
RepositoryException
-
newConflictItem
private ConflictResolver.ConflictItem newConflictItem(DependencyNode parent, DependencyNode node) throws RepositoryException
- Throws:
RepositoryException
-
depth
private int depth()
-
parent
private DependencyNode parent()
-
deriveScope
private java.lang.String deriveScope(DependencyNode node, java.lang.Object conflictId) throws RepositoryException
- Throws:
RepositoryException
-
scopes
private void scopes(int parent, Dependency child)
-
scope
private java.lang.String scope(Dependency dependency)
-
deriveOptional
private boolean deriveOptional(DependencyNode node, java.lang.Object conflictId)
-
-