Re: Column numbers in stack trace - enhancement request



How about including in NullPointerException the compile time type of the
subexpression that was null?


In addition, if the trace contains what method call was attempted on
the null variable, it might help differentiate many of the cases where
the return types of two methods in the same line are identical. JRE
should be able to provide the method name, shouldn't it?

Also, these data will help quite a bit even if the classes were built
without line number information. For those cases, in all but small
methods, it is pretty much impossible to figure out where a
NullPointerException could have occurred.

Of course, none of this is a must if a problem reported by production
users can be reproduced in the dev environment. It will be very easy to
attach the debugger to figure out the bug. But, I get bug reports quite
often that are not reproducible in the dev environment and stack trace
from the logs is all I have to figure out how to reproduce the problem.

I won't be writing any more code with multiple method calls in the same
line. At the same time, I have never seen any warning against this
practice in the Java books I've read or even Sun's Java coding
conventions. Are there any such warnings in some java book or coding
standard?

.



Relevant Pages

  • Soft-Lockup/Race in networking in 2.6.31-rc1+195 (possibly caused by netem)
    ... The simplest policy I could reproduce the error with was: ... I also could reproduce the issue without netconsole but in vain of a serial console could not capture a trace. ... # CPUFreq processor drivers ... # PC SMBus host controller drivers ...
    (Linux-Kernel)
  • Re: 2.6.26-git0: IDE oops during boot
    ... Could you try latest git and see if the OOPS is still there? ... I'm unable to reproduce it. ... The panic is reproducible with the 2.6.24-git16 kernel, the call trace is ... RSP ...
    (Linux-Kernel)
  • Re: Column numbers in stack trace - enhancement request
    ... if the trace contains what method call was attempted on ... practice in the Java books I've read or even Sun's Java coding ... I've never seen a warning against it on those grounds. ...
    (comp.lang.java.programmer)
  • Re: oops in proc_sys_compare
    ... Tried to reproduce ... it without success, then got a very similar trace from ... 2.6.27-rc3 itself doing the same test yesterday: ... but symbol addresses fit exactly with the trace (and the 2.6.27-rc1-mm1 ...
    (Linux-Kernel)
  • 2.6.29-rc7: ext4 hangs on sparc (was: next-20090310: ext4 hangs)
    ... I can not reproduce it. ... It is a slow system, I would not like to bisect it, only if it is the ... Call Trace: ...
    (Linux-Kernel)