|
|
|
|
|
by dbdr
3165 days ago
|
|
A code example contains: if (x.f != null) {
System.out.println(x.f.toString());
}
Apparently NullAway infers that x.f cannot be null inside the branch, so calling x.f.toString() is safe. However, strictly speaking, since field f is not final, it is possible that a different thread would modify it between the test and the call, resulting in a NullPointerException. Have you decided to just ignore such effects of multi-threading? |
|