item.addScope( childScope ); item.addOptional( childOptional );
private String chooseEffectiveScope( Collection<ConflictItem> items ) { Set<String> scopes = new HashSet<String>(); for ( ConflictItem item : items ) { if ( item.getDepth() <= 1 ) { return item.getDependency().getScope(); } scopes.addAll( item.getScopes() ); } return chooseEffectiveScope( scopes ); }
private void backtrack( ConflictGroup group, ConflictContext context ) throws UnsolvableVersionConflictException { group.winner = null; for ( Iterator<ConflictItem> it = group.candidates.iterator(); it.hasNext(); ) { ConflictItem candidate = it.next(); if ( !isAcceptable( group, candidate.getNode().getVersion() ) ) { it.remove(); } else if ( group.winner == null || isNearer( candidate, group.winner ) ) { group.winner = candidate; } } if ( group.winner == null ) { throw newFailure( context ); } }
item.addScope( childScope ); item.addOptional( childOptional );
loser.setData( NODE_DATA_ORIGINAL_SCOPE, loser.getDependency().getScope() ); loser.setData( NODE_DATA_ORIGINAL_OPTIONALITY, loser.getDependency().isOptional() ); loser.setScope( item.getScopes().iterator().next() ); loser.setChildren( Collections.<DependencyNode>emptyList() ); childIt.set( loser );
loser.setData( NODE_DATA_ORIGINAL_SCOPE, loser.getDependency().getScope() ); loser.setData( NODE_DATA_ORIGINAL_OPTIONALITY, loser.getDependency().isOptional() ); loser.setScope( item.getScopes().iterator().next() ); loser.setChildren( Collections.<DependencyNode> emptyList() ); childIt.set( loser );
private void backtrack( ConflictGroup group, ConflictContext context ) throws UnsolvableVersionConflictException { group.winner = null; for ( Iterator<ConflictItem> it = group.candidates.iterator(); it.hasNext(); ) { ConflictItem candidate = it.next(); if ( !isAcceptable( group, candidate.getNode().getVersion() ) ) { it.remove(); } else if ( group.winner == null || isNearer( candidate, group.winner ) ) { group.winner = candidate; } } if ( group.winner == null ) { throw newFailure( context ); } }
private boolean chooseEffectiveOptionality( Collection<ConflictItem> items ) { boolean optional = true; for ( ConflictItem item : items ) { if ( item.getDepth() <= 1 ) { return item.getDependency().isOptional(); } if ( ( item.getOptionalities() & ConflictItem.OPTIONAL_FALSE ) != 0 ) { optional = false; } } return optional; }
private boolean chooseEffectiveOptionality( Collection<ConflictItem> items ) { boolean optional = true; for ( ConflictItem item : items ) { if ( item.getDepth() <= 1 ) { return item.getDependency().isOptional(); } if ( ( item.getOptionalities() & ConflictItem.OPTIONAL_FALSE ) != 0 ) { optional = false; } } return optional; }
@Override public void selectScope( ConflictContext context ) throws RepositoryException { String scope = context.getWinner().getDependency().getScope(); if ( !JavaScopes.SYSTEM.equals( scope ) ) { scope = chooseEffectiveScope( context.getItems() ); } context.setScope( scope ); }
private ConflictItem newConflictItem( DependencyNode parent, DependencyNode node ) throws RepositoryException { return new ConflictItem( parent, node, deriveScope( node, null ), deriveOptional( node, null ) ); }
private String chooseEffectiveScope( Collection<ConflictItem> items ) { Set<String> scopes = new HashSet<String>(); for ( ConflictItem item : items ) { if ( item.getDepth() <= 1 ) { return item.getDependency().getScope(); } scopes.addAll( item.getScopes() ); } return chooseEffectiveScope( scopes ); }
@Override public void selectScope( ConflictContext context ) throws RepositoryException { String scope = context.getWinner().getDependency().getScope(); if ( !JavaScopes.SYSTEM.equals( scope ) ) { scope = chooseEffectiveScope( context.getItems() ); } context.setScope( scope ); }
private ConflictItem newConflictItem( DependencyNode parent, DependencyNode node ) throws RepositoryException { return new ConflictItem( parent, node, deriveScope( node, null ), deriveOptional( node, null ) ); }