Debian Codegraph @

checker/tests/initialization/fbc/Issue905.java

raw
1 // Test case for Issue 905:
2 // https://github.com/typetools/checker-framework/issues/905
3
4 import org.checkerframework.checker.initialization.qual.UnknownInitialization;
5
6 public class Issue905 {
7 final Object mBar;
8
9 Issue905() {
10 // this should be @UnderInitialization(Object.class), so this call
11 // should be forbidden.
12 // :: error: (method.invocation.invalid)
13 baz();
14 mBar = "";
15 }
16
17 Issue905(int i) {
18 mBar = "";
19 baz();
20 }
21
22 void baz(@UnknownInitialization(Issue905.class) Issue905 this) {
23 mBar.toString();
24 }
25
26 public static void main(String[] args) {
27 new Issue905();
28 }
29 }