| 1 |
// Test case for Issue 408: |
| 2 |
// https://github.com/typetools/checker-framework/issues/408 |
| 3 |
|
| 4 |
import org.checkerframework.checker.initialization.qual.UnderInitialization; |
| 5 |
|
| 6 |
public class Issue408Init { |
| 7 |
static class Bar { |
| 8 |
Bar() { |
| 9 |
doFoo(); |
| 10 |
} |
| 11 |
|
| 12 |
String doFoo(@UnderInitialization Bar this) { |
| 13 |
return ""; |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
static class Baz extends Bar { |
| 18 |
String myString = "hello"; |
| 19 |
|
| 20 |
@Override |
| 21 |
String doFoo(@UnderInitialization Baz this) { |
| 22 |
// :: error: (dereference.of.nullable) |
| 23 |
return myString.toLowerCase(); |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
public static void main(String[] args) { |
| 28 |
new Baz(); |
| 29 |
} |
| 30 |
} |