Column numbers is stack trace - enhancement request

Discussion in 'Java' started by Sasi, Jan 15, 2007.

  1. Sasi

    Sasi Guest

    I filed the following enhancement request to Sun. Would like to hear
    opinion about how useful implementing this feature would be.

    Synopsis: Need column numbers in stack traces
    Description:
    A DESCRIPTION OF THE REQUEST :
    Stack traces contain only line numbers and in certain cases line number
    alone is not sufficient for figuring out where exactly an exception
    occurred. Consider the following line of code.

    value = getItem().getRelatedItem().getName().getValue();

    If the above line throws a NullPointerException, we have no clue
    whether it is the getItem, getRelatedItem or the getName that is
    returning a null value. So providing just the line number is not
    sufficiently helpful in narrowing down the problem. If the stack trace
    also contains the column number where the null was encountered, it will
    be really helpful.

    Though the above code could be rewritten to several lines so that we
    can clearly identify which method returned null, there are tons of such
    existing code and changing them all will be an unreasonably complex
    task.
    Sasi, Jan 15, 2007
    #1
    1. Advertising

  2. Sasi

    Sasi Guest

    Please ignore this thread. I've created another thread due to the typo
    in the subject.

    Sasi wrote:
    > I filed the following enhancement request to Sun. Would like to hear
    > opinion about how useful implementing this feature would be.
    >
    > Synopsis: Need column numbers in stack traces
    > Description:
    > A DESCRIPTION OF THE REQUEST :
    > Stack traces contain only line numbers and in certain cases line number
    > alone is not sufficient for figuring out where exactly an exception
    > occurred. Consider the following line of code.
    >
    > value = getItem().getRelatedItem().getName().getValue();
    >
    > If the above line throws a NullPointerException, we have no clue
    > whether it is the getItem, getRelatedItem or the getName that is
    > returning a null value. So providing just the line number is not
    > sufficiently helpful in narrowing down the problem. If the stack trace
    > also contains the column number where the null was encountered, it will
    > be really helpful.
    >
    > Though the above code could be rewritten to several lines so that we
    > can clearly identify which method returned null, there are tons of such
    > existing code and changing them all will be an unreasonably complex
    > task.
    Sasi, Jan 15, 2007
    #2
    1. Advertising

  3. Sasi wrote:

    Please refrain from top-posting, even when responding
    to your own cancelled thread. It would also have been
    sensible to trim the majority of the earlier post, as it
    was not relevant to your immediate reply.

    > Please ignore this thread.


    No.

    >...I've created another thread due to the typo in the subject.


    The typing error was trivial - I did not notice it
    until you mentioned it. In any case, a typing
    error in the title is not something that justifies
    a repost.

    > Sasi wrote:
    > > I filed the following enhancement request to Sun. Would like to hear
    > > opinion about how useful implementing this feature would be.


    Almost no use. If it would require more bytes
    in the code, or the VM, I would go on to say it
    that adding that 'feature' would be a detriment.
    (Especially for encouraging the production of
    more crap code, like what you posted)

    Let us know the URL of the bug report, so I
    can vote against it.

    Andrew T.
    Andrew Thompson, Jan 15, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BillGatesFan

    Displaying Line Numbers in the stack trace

    BillGatesFan, Mar 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    397
    BillGatesFan
    Mar 23, 2005
  2. Usenet User

    Q: Numbers in stack trace?

    Usenet User, Apr 6, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    408
    Michael Kellogg
    Apr 8, 2006
  3. TS
    Replies:
    4
    Views:
    935
  4. Sasi
    Replies:
    13
    Views:
    545
    Chris Uppal
    Jan 22, 2007
  5. John Kotuby
    Replies:
    2
    Views:
    1,065
    George Ter-Saakov
    Mar 7, 2007
Loading...

Share This Page