Re: Column numbers in stack trace - enhancement request
- From: "Sasi" <kvsasi@xxxxxxxxxxx>
- Date: 18 Jan 2007 15:26:07 -0800
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?
.
- Follow-Ups:
- Re: Column numbers in stack trace - enhancement request
- From: Chris Uppal
- Re: Column numbers in stack trace - enhancement request
- From: Lew
- Re: Column numbers in stack trace - enhancement request
- References:
- Column numbers in stack trace - enhancement request
- From: Sasi
- Re: Column numbers in stack trace - enhancement request
- From: Patricia Shanahan
- Re: Column numbers in stack trace - enhancement request
- From: Chris Uppal
- Column numbers in stack trace - enhancement request
- Prev by Date: Re: [Algorithm] Sum of Primes < 1000000
- Next by Date: Re: How to check variables for uniqueness ?
- Previous by thread: Re: Column numbers in stack trace - enhancement request
- Next by thread: Re: Column numbers in stack trace - enhancement request
- Index(es):
Relevant Pages
|