3 ms·
Oh yes. Did you ever have a statement where you chain more than two method calls and don't know which returns null? I tend to split calls like this on separate
by pvorb 6y ago
Oh yes. Did you ever have a statement where you chain more than two method calls and don't know which returns null? I tend to split calls like this on separate lines just to be able to tell which call returns null from the line number in the stack trace.
obj.call1().call2().call3();
becomes
obj.call1()
.call2()
.call3();
And if I now get an NPE at line three, I know that call2() returned null.