|
|
|
|
|
by struppi
3116 days ago
|
|
Absolutely. So, what I started to do in my java code:
Before dereferncing anything for the first time, i add assert foo != null : "foo must not be null - remember to wrap optional data in Optional<T>"
Just make sure to run your program (or at least the tests) with the JVM flag "-ea" |
|
If asserts are disabled, then the null pointer checks are still inserted by the JVM.