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 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 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 ); }