341 |
|
} |
342 |
|
|
343 |
|
/** |
344 |
< |
* toArray(null) throws NPE |
344 |
> |
* toArray(null) throws NullPointerException |
345 |
|
*/ |
346 |
< |
public void testToArray_BadArg() { |
346 |
> |
public void testToArray_NullArg() { |
347 |
|
LinkedList l = new LinkedList(); |
348 |
|
l.add(new Object()); |
349 |
|
try { |
350 |
< |
Object o[] = l.toArray(null); |
350 |
> |
l.toArray(null); |
351 |
|
shouldThrow(); |
352 |
|
} catch (NullPointerException success) {} |
353 |
|
} |
354 |
|
|
355 |
|
/** |
356 |
< |
* toArray with incompatible array type throws CCE |
356 |
> |
* toArray(incompatible array type) throws ArrayStoreException |
357 |
|
*/ |
358 |
|
public void testToArray1_BadArg() { |
359 |
|
LinkedList l = new LinkedList(); |
360 |
|
l.add(new Integer(5)); |
361 |
|
try { |
362 |
< |
Object o[] = l.toArray(new String[10]); |
362 |
> |
l.toArray(new String[10]); |
363 |
|
shouldThrow(); |
364 |
|
} catch (ArrayStoreException success) {} |
365 |
|
} |