| 1 |
import org.checkerframework.checker.initialization.qual.NotOnlyInitialized; |
| 2 |
import org.checkerframework.checker.initialization.qual.UnknownInitialization; |
| 3 |
import org.checkerframework.checker.nullness.qual.NonNull; |
| 4 |
import org.checkerframework.checker.nullness.qual.Nullable; |
| 5 |
|
| 6 |
public class FlowFbc { |
| 7 |
|
| 8 |
@NonNull String f; |
| 9 |
@NotOnlyInitialized @NonNull String g; |
| 10 |
|
| 11 |
public FlowFbc(String arg) { |
| 12 |
// :: error: (dereference.of.nullable) |
| 13 |
f.toLowerCase(); |
| 14 |
// :: error: (dereference.of.nullable) |
| 15 |
g.toLowerCase(); |
| 16 |
f = arg; |
| 17 |
g = arg; |
| 18 |
foo(); |
| 19 |
f.toLowerCase(); |
| 20 |
// :: error: (method.invocation.invalid) |
| 21 |
g.toLowerCase(); |
| 22 |
f = arg; |
| 23 |
} |
| 24 |
|
| 25 |
void test() { |
| 26 |
@Nullable String s = null; |
| 27 |
s = "a"; |
| 28 |
s.toLowerCase(); |
| 29 |
} |
| 30 |
|
| 31 |
void test2(@Nullable String s) { |
| 32 |
if (s != null) { |
| 33 |
s.toLowerCase(); |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
void foo(@UnknownInitialization FlowFbc this) {} |
| 38 |
|
| 39 |
// TODO Pure, etc. |
| 40 |
} |