# | Line 702 | Line 702 | public class ArrayBlockingQueue<E> exten | |
---|---|---|
702 | } | |
703 | ||
704 | public E next() { | |
705 | – | if (remaining <= 0) |
706 | – | throw new NoSuchElementException(); |
705 | final ReentrantLock lock = ArrayBlockingQueue.this.lock; | |
706 | lock.lock(); | |
707 | try { | |
708 | + | if (remaining <= 0) |
709 | + | throw new NoSuchElementException(); |
710 | lastRet = nextIndex; | |
711 | E x = lastItem = nextItem; | |
712 | while (--remaining > 0) { |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |