On 26/11/13 05:30, Steve Dougherty wrote:
>
> In src/freenet/support/RandomGrabHashSet.java:
>
> > +    protected boolean indexIsValid() {
> > +        if(index.size() != data.size())
> > +            return false;
> > +        
> > +        for(Entry<E, Integer> entry : index.entrySet()) {
> > +            if(!data.get(entry.getValue()).equals(entry.getKey()))
> > +                return false;
> > +        }
> > +        
> > +        return true;
> > +    }
> > +    
> > +    /**
> > +     * @throws IllegalArgumentException If the element is already contained in the set.
> > +     */
> > +    public void add(final E item) {
>
> Throwing is surprising to me - I'd expect adding something to a set to
> add it if it doesn't exist already and otherwise do nothing.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/freenet/fred-staging/pull/200/files#r7915737>.
>
Don't know, suggest you check the callers... it might mean that if it's
already in the set then something must be seriously wrong?