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()); |
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 |
|
/** |
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 |
+ |
/** |
73 |
|
* get returns the last value set or assigned |
74 |
|
*/ |
75 |
|
public void testGetSet() { |