13 |
|
volatile Integer x = null; |
14 |
|
Object z; |
15 |
|
Integer w; |
16 |
+ |
volatile int i; |
17 |
|
|
18 |
|
public static void main(String[] args) { |
19 |
|
junit.textui.TestRunner.run(suite()); |
34 |
|
try { |
35 |
|
updaterFor("y"); |
36 |
|
shouldThrow(); |
37 |
< |
} catch (RuntimeException success) {} |
37 |
> |
} catch (RuntimeException success) { |
38 |
> |
assertNotNull(success.getCause()); |
39 |
> |
} |
40 |
|
} |
41 |
|
|
42 |
|
/** |
43 |
< |
* construction with field not of given type throws RuntimeException |
43 |
> |
* construction with field not of given type throws ClassCastException |
44 |
|
*/ |
45 |
|
public void testConstructor2() { |
46 |
|
try { |
47 |
|
updaterFor("z"); |
48 |
|
shouldThrow(); |
49 |
< |
} catch (RuntimeException success) {} |
49 |
> |
} catch (ClassCastException success) {} |
50 |
|
} |
51 |
|
|
52 |
|
/** |
53 |
< |
* Constructor with non-volatile field throws exception |
53 |
> |
* Constructor with non-volatile field throws IllegalArgumentException |
54 |
|
*/ |
55 |
|
public void testConstructor3() { |
56 |
|
try { |
57 |
|
updaterFor("w"); |
58 |
|
shouldThrow(); |
59 |
< |
} catch (RuntimeException success) {} |
59 |
> |
} catch (IllegalArgumentException success) {} |
60 |
> |
} |
61 |
> |
|
62 |
> |
/** |
63 |
> |
* Constructor with non-reference field throws ClassCastException |
64 |
> |
*/ |
65 |
> |
public void testConstructor4() { |
66 |
> |
try { |
67 |
> |
updaterFor("i"); |
68 |
> |
shouldThrow(); |
69 |
> |
} catch (ClassCastException success) {} |
70 |
|
} |
71 |
|
|
72 |
|
/** |