Re: Column numbers in stack trace - enhancement request



Sasi wrote:

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?

The JMV could certainly record what the failed operation had been (it doesn't
have to be a method call, it could be a field access or an index into an array
for instance). But remember that NPEs can be thrown explicitly too -- that
doesn't mean that the information couldn't be recorded when it was generated by
the JVM, but that wouldn't always be the case.


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?

I've never seen a warning against it on those grounds. One partial reason
might be that it's only recently (since 1.5 as I recall) that Sun's compilers
have routinely included line number information in .class files at all (it has
always been available as an option, but was not the default) and without that
you don't get line number information in stack traces.

-- chris


.



Relevant Pages

  • bug: hid module crashed
    ... Warning: You did not tell me where to find symbol information. ... assume that the log matches the kernel and modules that are running ... If the current kernel and/or modules do not match the log, ... Trace; f899c23e ...
    (Linux-Kernel)
  • Re: Column numbers in stack trace - enhancement request
    ... if the trace contains what method call was attempted on ... from the logs is all I have to figure out how to reproduce the problem. ... practice in the Java books I've read or even Sun's Java coding ...
    (comp.lang.java.programmer)
  • Re: 2.6.17-mm3 - mutex warning in usbhid, battery problem, and slab corruption
    ... there's a mutex lock warning as in the appended trace and my USB ... Second, kpowersave is apparently unable to get the battery status, ...
    (Linux-Kernel)
  • Re: Fix quilt merge error in acpi-cpufreq.c
    ... Commit: 1c98aa7424ff163637d8321674ec58dee28152d4 ... that warning is back and triggered in overnight testing: ... Call Trace: ... was essentially unused before - an IPI function should not trigger ...
    (Linux-Kernel)
  • Re: Oops with 2.6.1-rc2-mm1
    ... EIP is at try_to_unmap_one+0x1c4/0x1e0 ... Call Trace: ... Unable to handle kernel paging request at virtual address 1877d029 ... Warning: You did not tell me where to find symbol information. ...
    (Linux-Kernel)