27 |
|
import java.util.Arrays; |
28 |
|
import java.util.Date; |
29 |
|
import java.util.Enumeration; |
30 |
+ |
import java.util.Iterator; |
31 |
|
import java.util.List; |
32 |
|
import java.util.NoSuchElementException; |
33 |
|
import java.util.PropertyPermission; |
466 |
|
} |
467 |
|
|
468 |
|
/** |
469 |
< |
* Find missing try { ... } finally { joinPool(e); } |
469 |
> |
* Finds missing try { ... } finally { joinPool(e); } |
470 |
|
*/ |
471 |
|
void checkForkJoinPoolThreadLeaks() throws InterruptedException { |
472 |
|
Thread[] survivors = new Thread[5]; |
925 |
|
/** |
926 |
|
* Returns the number of milliseconds since time given by |
927 |
|
* startNanoTime, which must have been previously returned from a |
928 |
< |
* call to {@link System.nanoTime()}. |
928 |
> |
* call to {@link System#nanoTime()}. |
929 |
|
*/ |
930 |
|
static long millisElapsedSince(long startNanoTime) { |
931 |
|
return NANOSECONDS.toMillis(System.nanoTime() - startNanoTime); |
1469 |
|
shouldThrow(expectedExceptionClass.getName()); |
1470 |
|
} |
1471 |
|
} |
1472 |
+ |
|
1473 |
+ |
public void assertIteratorExhausted(Iterator<?> it) { |
1474 |
+ |
try { |
1475 |
+ |
it.next(); |
1476 |
+ |
shouldThrow(); |
1477 |
+ |
} catch (NoSuchElementException success) {} |
1478 |
+ |
assertFalse(it.hasNext()); |
1479 |
+ |
} |
1480 |
|
} |