checker/tests/nullness/init/Issue904.java
raw| 1 | // Test case for Issue 904: |
| 2 | // https://github.com/typetools/checker-framework/issues/904 |
| 3 | |
| 4 | // @skip-test |
| 5 | |
| 6 | public class Issue904 { |
| 7 | final Object mBar; |
| 8 | final Runnable mRunnable = |
| 9 | new Runnable() { |
| 10 | @Override |
| 11 | public void run() { |
| 12 | // :: error: (dereference.of.nullable) |
| 13 | mBar.toString(); |
| 14 | } |
| 15 | }; |
| 16 | |
| 17 | public Issue904() { |
| 18 | mRunnable.run(); |
| 19 | mBar = ""; |
| 20 | } |
| 21 | |
| 22 | public static void main(String[] args) { |
| 23 | new Issue904(); |
| 24 | } |
| 25 | } |