746 |
|
* The following code can be used to dump the deque into a newly |
747 |
|
* allocated array of {@code String}: |
748 |
|
* |
749 |
< |
* <pre> {@code String[] y = x.toArray(new String[0]);}</pre> |
749 |
> |
* <pre> {@code String[] y = x.toArray(new String[0]);}</pre> |
750 |
|
* |
751 |
|
* Note that {@code toArray(new Object[0])} is identical in function to |
752 |
|
* {@code toArray()}. |
901 |
|
throw new NullPointerException(); |
902 |
|
Object[] a = deq.elements; |
903 |
|
int m = a.length - 1, f = getFence(), i = index; |
904 |
< |
if (i != fence) { |
904 |
> |
if (i != f) { |
905 |
|
@SuppressWarnings("unchecked") E e = (E)a[i]; |
906 |
|
index = (i + 1) & m; |
907 |
|
if (e == null) |