1 |
|
/* |
2 |
|
* Written by Josh Bloch and Doug Lea with assistance from members of |
3 |
|
* JCP JSR-166 Expert Group and released to the public domain, as |
4 |
< |
* explained at http://creativecommons.org/licenses/publicdomain |
4 |
> |
* explained at http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
import java.util.*; |
174 |
|
if (!all.equals(s)) |
175 |
|
fail("Failed to reconstruct ints from odds and evens."); |
176 |
|
|
177 |
< |
all = clone(odd, cl, synch); |
177 |
> |
all = clone(odd, cl, synch); |
178 |
|
ListIterator<Integer> itAll = all.listIterator(all.size()); |
179 |
|
ListIterator<Integer> itEven = even.listIterator(even.size()); |
180 |
|
while (itEven.hasPrevious()) { |
205 |
|
Object o = it.next(); |
206 |
|
if (all.indexOf(o) != all.lastIndexOf(o)) |
207 |
|
fail("Apparent duplicate detected."); |
208 |
< |
if (all.subList(i, all.size()).indexOf(o) != 0) { |
208 |
> |
if (all.subList(i, all.size()).indexOf(o) != 0) { |
209 |
|
System.out.println("s0: " + all.subList(i, all.size()).indexOf(o)); |
210 |
|
fail("subList/indexOf is screwy."); |
211 |
|
} |
278 |
|
|
279 |
|
int preSize = s.size(); |
280 |
|
if (!s.add(e)) |
281 |
< |
fail ("Add failed."); |
281 |
> |
fail("Add failed."); |
282 |
|
int postSize = s.size(); |
283 |
|
if (postSize-preSize != 1) |
284 |
< |
fail ("Add didn't increase size by 1."); |
284 |
> |
fail("Add didn't increase size by 1."); |
285 |
|
} |
286 |
|
} |
287 |
|
|