I'm reading the source of java.util.concurrent.ArrayBlockingQueue, and found some code I don't understand:
private final ReentrantLock lock;
public boolean offer(E e) {
    if (e == null) throw new NullPointerException();
    final ReentrantLock lock = this.lock;
    lock.lock();
    try {
        if (count == items.length)
            return false;
        else {
            insert(e);
            return true;
        }
    } finally {
        lock.unlock();
    }
}
Notice this line:
final ReentrantLock lock = this.lock;
Why it doesn't use this.lock directly, but assigns it to a local variable?
 
     
     
     
    