1036 |
|
* |
1037 |
|
* @return an empty iterator |
1038 |
|
*/ |
1039 |
+ |
@SuppressWarnings("unchecked") |
1040 |
|
public Iterator<E> iterator() { |
1041 |
< |
return Collections.emptyIterator(); |
1041 |
> |
return (Iterator<E>) EmptyIterator.EMPTY_ITERATOR; |
1042 |
> |
} |
1043 |
> |
|
1044 |
> |
// Replicated from a previous version of Collections |
1045 |
> |
private static class EmptyIterator<E> implements Iterator<E> { |
1046 |
> |
static final EmptyIterator<Object> EMPTY_ITERATOR |
1047 |
> |
= new EmptyIterator<Object>(); |
1048 |
> |
|
1049 |
> |
public boolean hasNext() { return false; } |
1050 |
> |
public E next() { throw new NoSuchElementException(); } |
1051 |
> |
public void remove() { throw new IllegalStateException(); } |
1052 |
|
} |
1053 |
|
|
1054 |
|
/** |