Why not? the instance `limit` must be in `orderedIds` as it has come from
an iterator based on `orderedIds`. Unless the iterator is doing a copy
which would be extremely surprising behaviour.


On 29 August 2013 18:00, oli-hall <notifications@github.com> wrote:

> In src/main/java/org/atlasapi/util/GroupLock.java:
>
> > +    public boolean tryLock(Iterable<T> ids) throws InterruptedException {
> > +        synchronized (locked) {
> > +            List<T> orderedIds = ordering.sortedCopy(ids);
> > +            for (T id : orderedIds) {
> > +                if (!tryLock(id)) {
> > +                    unlockTill(orderedIds, id);
> > +                    return false;
> > +                }
> > +            }
> > +            return true;
> > +        }
> > +    }
> > +
> > +    private void unlockTill(List<T> orderedIds, T limit) {
> > +        for (T id : orderedIds) {
> > +            if (id == limit) {
>
> do you want reference equality here?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/atlasapi/atlas-model/pull/145/files#r6066490>
> .
>