mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 05:52:26 +00:00
fixed a problem in the iterator as pointed out by Jesse.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1645 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
e68917b5f3
commit
1d62e9c259
1 file changed
+19
-1
@@ -44,7 +44,25 @@ public class CopyOnWriteList<E> implements Iterable<E> {
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator.
|
||||
*
|
||||
* The returned iterator doesn't support the <tt>remove</tt> operation.
|
||||
*/
|
||||
public Iterator<E> iterator() {
|
||||
return core.iterator();
|
||||
final Iterator<E> itr = core.iterator();
|
||||
return new Iterator<E>() {
|
||||
public boolean hasNext() {
|
||||
return itr.hasNext();
|
||||
}
|
||||
|
||||
public E next() {
|
||||
return itr.next();
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user