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.
The issue isn't JVM reporting a wrong line number, but the debugger implementations not using the info correctly. IntelliJ for example does not show nor reorder lines for decompiled classes, need to set "decompiler.dump.original.lines=true" in registry to get anything useful.
And even then for instrumented code, the debugger could ask the JVM for more correct bytes than the class file via the JDI Method#getByteCode, but i guess the need for debugging instrumented code is too low for them to consider that. It would also need changing the decompiler a bit as they are designed with a full class in mind, so might need some untangling to work on just method bytecode, const pool and other stuff asked via JDI.
-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.