93 |
|
ConcurrentHashMap map = map5(); |
94 |
|
Enumeration e = map.elements(); |
95 |
|
int count = 0; |
96 |
< |
while(e.hasMoreElements()){ |
96 |
> |
while (e.hasMoreElements()){ |
97 |
|
count++; |
98 |
|
e.nextElement(); |
99 |
|
} |
128 |
|
ConcurrentHashMap map = map5(); |
129 |
|
Enumeration e = map.keys(); |
130 |
|
int count = 0; |
131 |
< |
while(e.hasMoreElements()){ |
131 |
> |
while (e.hasMoreElements()){ |
132 |
|
count++; |
133 |
|
e.nextElement(); |
134 |
|
} |
351 |
|
try { |
352 |
|
new ConcurrentHashMap(-1,0,1); |
353 |
|
shouldThrow(); |
354 |
< |
} catch(IllegalArgumentException e){} |
354 |
> |
} catch (IllegalArgumentException e){} |
355 |
|
} |
356 |
|
|
357 |
|
/** |
361 |
|
try { |
362 |
|
new ConcurrentHashMap(1,0,-1); |
363 |
|
shouldThrow(); |
364 |
< |
} catch(IllegalArgumentException e){} |
364 |
> |
} catch (IllegalArgumentException e){} |
365 |
|
} |
366 |
|
|
367 |
|
/** |
371 |
|
try { |
372 |
|
new ConcurrentHashMap(-1); |
373 |
|
shouldThrow(); |
374 |
< |
} catch(IllegalArgumentException e){} |
374 |
> |
} catch (IllegalArgumentException e){} |
375 |
|
} |
376 |
|
|
377 |
|
/** |
382 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
383 |
|
c.get(null); |
384 |
|
shouldThrow(); |
385 |
< |
} catch(NullPointerException e){} |
385 |
> |
} catch (NullPointerException e){} |
386 |
|
} |
387 |
|
|
388 |
|
/** |
393 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
394 |
|
c.containsKey(null); |
395 |
|
shouldThrow(); |
396 |
< |
} catch(NullPointerException e){} |
396 |
> |
} catch (NullPointerException e){} |
397 |
|
} |
398 |
|
|
399 |
|
/** |
404 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
405 |
|
c.containsValue(null); |
406 |
|
shouldThrow(); |
407 |
< |
} catch(NullPointerException e){} |
407 |
> |
} catch (NullPointerException e){} |
408 |
|
} |
409 |
|
|
410 |
|
/** |
415 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
416 |
|
c.contains(null); |
417 |
|
shouldThrow(); |
418 |
< |
} catch(NullPointerException e){} |
418 |
> |
} catch (NullPointerException e){} |
419 |
|
} |
420 |
|
|
421 |
|
/** |
426 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
427 |
|
c.put(null, "whatever"); |
428 |
|
shouldThrow(); |
429 |
< |
} catch(NullPointerException e){} |
429 |
> |
} catch (NullPointerException e){} |
430 |
|
} |
431 |
|
|
432 |
|
/** |
437 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
438 |
|
c.put("whatever", null); |
439 |
|
shouldThrow(); |
440 |
< |
} catch(NullPointerException e){} |
440 |
> |
} catch (NullPointerException e){} |
441 |
|
} |
442 |
|
|
443 |
|
/** |
448 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
449 |
|
c.putIfAbsent(null, "whatever"); |
450 |
|
shouldThrow(); |
451 |
< |
} catch(NullPointerException e){} |
451 |
> |
} catch (NullPointerException e){} |
452 |
|
} |
453 |
|
|
454 |
|
/** |
459 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
460 |
|
c.replace(null, "whatever"); |
461 |
|
shouldThrow(); |
462 |
< |
} catch(NullPointerException e){} |
462 |
> |
} catch (NullPointerException e){} |
463 |
|
} |
464 |
|
|
465 |
|
/** |
470 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
471 |
|
c.replace(null, one, "whatever"); |
472 |
|
shouldThrow(); |
473 |
< |
} catch(NullPointerException e){} |
473 |
> |
} catch (NullPointerException e){} |
474 |
|
} |
475 |
|
|
476 |
|
/** |
481 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
482 |
|
c.putIfAbsent("whatever", null); |
483 |
|
shouldThrow(); |
484 |
< |
} catch(NullPointerException e){} |
484 |
> |
} catch (NullPointerException e){} |
485 |
|
} |
486 |
|
|
487 |
|
|
493 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
494 |
|
c.replace("whatever", null); |
495 |
|
shouldThrow(); |
496 |
< |
} catch(NullPointerException e){} |
496 |
> |
} catch (NullPointerException e){} |
497 |
|
} |
498 |
|
|
499 |
|
/** |
504 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
505 |
|
c.replace("whatever", null, "A"); |
506 |
|
shouldThrow(); |
507 |
< |
} catch(NullPointerException e){} |
507 |
> |
} catch (NullPointerException e){} |
508 |
|
} |
509 |
|
|
510 |
|
/** |
515 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
516 |
|
c.replace("whatever", one, null); |
517 |
|
shouldThrow(); |
518 |
< |
} catch(NullPointerException e){} |
518 |
> |
} catch (NullPointerException e){} |
519 |
|
} |
520 |
|
|
521 |
|
|
528 |
|
c.put("sadsdf", "asdads"); |
529 |
|
c.remove(null); |
530 |
|
shouldThrow(); |
531 |
< |
} catch(NullPointerException e){} |
531 |
> |
} catch (NullPointerException e){} |
532 |
|
} |
533 |
|
|
534 |
|
/** |
540 |
|
c.put("sadsdf", "asdads"); |
541 |
|
c.remove(null, "whatever"); |
542 |
|
shouldThrow(); |
543 |
< |
} catch(NullPointerException e){} |
543 |
> |
} catch (NullPointerException e){} |
544 |
|
} |
545 |
|
|
546 |
|
/** |
551 |
|
ConcurrentHashMap c = new ConcurrentHashMap(5); |
552 |
|
c.put("sadsdf", "asdads"); |
553 |
|
assertFalse(c.remove("sadsdf", null)); |
554 |
< |
} catch(NullPointerException e){ |
554 |
> |
} catch (NullPointerException e){ |
555 |
|
fail(); |
556 |
|
} |
557 |
|
} |
574 |
|
assertEquals(q.size(), r.size()); |
575 |
|
assertTrue(q.equals(r)); |
576 |
|
assertTrue(r.equals(q)); |
577 |
< |
} catch(Exception e){ |
577 |
> |
} catch (Exception e){ |
578 |
|
e.printStackTrace(); |
579 |
|
unexpectedException(); |
580 |
|
} |