36 |
|
try { |
37 |
|
Integer[] a = null; |
38 |
|
AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(a); |
39 |
+ |
shouldThrow(); |
40 |
|
} catch (NullPointerException success) { |
40 |
– |
} catch (Exception ex) { |
41 |
– |
unexpectedException(); |
42 |
– |
} |
41 |
|
} |
42 |
|
|
43 |
|
/** |
59 |
|
AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(SIZE); |
60 |
|
try { |
61 |
|
ai.get(SIZE); |
62 |
+ |
shouldThrow(); |
63 |
|
} catch (IndexOutOfBoundsException success) { |
64 |
|
} |
65 |
|
try { |
66 |
|
ai.get(-1); |
67 |
+ |
shouldThrow(); |
68 |
|
} catch (IndexOutOfBoundsException success) { |
69 |
|
} |
70 |
|
try { |
71 |
|
ai.set(SIZE, null); |
72 |
+ |
shouldThrow(); |
73 |
|
} catch (IndexOutOfBoundsException success) { |
74 |
|
} |
75 |
|
try { |
76 |
|
ai.set(-1, null); |
77 |
+ |
shouldThrow(); |
78 |
|
} catch (IndexOutOfBoundsException success) { |
79 |
|
} |
80 |
|
} |