private Iterable<T> copyIterable() { readLock.lock(); try { List<T> copy = new ArrayList<>(); for (Iterator<T> it = super.iterator(); it.hasNext(); ) { T element = it.next(); copy.add(element); } return copy; } finally { readLock.unlock(); } } }
private Iterable<T> copyIterable() { readLock.lock(); try { List<T> copy = new ArrayList<>(); for (Iterator<T> it = super.iterator(); it.hasNext(); ) { T element = it.next(); copy.add(element); } return copy; } finally { readLock.unlock(); } } }
private Iterable<T> copyIterable() { readLock.lock(); try { List<T> copy = new ArrayList<>(); for (Iterator<T> it = super.iterator(); it.hasNext(); ) { T element = it.next(); copy.add(element); } return copy; } finally { readLock.unlock(); } } }
private Iterable<T> copyIterable() { readLock.lock(); try { List<T> copy = new ArrayList<>(); for (Iterator<T> it = super.iterator(); it.hasNext(); ) { T element = it.next(); copy.add(element); } return copy; } finally { readLock.unlock(); } } }