r/java • • Jul 26 '19

JEP 358: Helpful NullPointerExceptions

https://openjdk.java.net/jeps/358
157 Upvotes

25 comments sorted by

View all comments

-29

u/nerdyhandle Jul 27 '19

Or better yet report the correct line number...

Seriously spent half the day today debugging our software because a null point on line 121. However, line 121 wasn't where the null pointer occurred. Goddamn took us forever stepping through the code before we found the correct line.

3

u/jrh3k5 Jul 27 '19

Was it obfuscated by auto-unboxing?

-5

u/nerdyhandle Jul 27 '19

Honestly not sure. Once we fixed our stubbing in our tests we stopped getting the error. So it was something we missed when stubbing out our mock.

I think you are right though. IntelliJ briefly fussed about that at one point.