/** * Setter for property {@code dependencies}. * * @param value the new dependencies for the collection. * * @throws DuplicateDependencyException if {@code value} contains duplicate * dependencies. */ public void setDependencies( final Dependency[] value ) { this.names.clear(); this.hashCode = 0; this.dependencies = null; if ( value != null ) { for ( int i = value.length - 1; i >= 0; i-- ) { this.hashCode += value[i].hashCode(); if ( this.names.put( value[i].getName(), value[i] ) != null ) { this.names.clear(); this.hashCode = 0; throw new DuplicateDependencyException( value[i].getName() ); } } this.dependencies = value; } }