How can i automatically find all unhandled exceptions in my java code?

Discussion in 'Java' started by upsa, Mar 14, 2007.

  1. upsa

    upsa Guest

    see subj,
    Thanks.
    upsa, Mar 14, 2007
    #1
    1. Advertising

  2. upsa

    Eric Sosman Guest

    Re: How can i automatically find all unhandled exceptions in my javacode?

    upsa wrote:
    > see subj,
    > Thanks.


    See sig.
    --
    Eric Sosman
    lid
    Read the error messages from javac.
    Eric Sosman, Mar 14, 2007
    #2
    1. Advertising

  3. upsa

    Stefan Ram Guest

    Eric Sosman <> writes:
    >>see subj,

    >See sig.


    See »X-Readme« header.
    Stefan Ram, Mar 14, 2007
    #3
  4. upsa

    upsa Guest

    On 14 ÍÁÒ, 02:48, -berlin.de (Stefan Ram) wrote:
    > Eric Sosman <> writes:
    > >>see subj,

    > >See sig.

    >
    > See >X-Readme< header.


    What did you mean ?
    upsa, Mar 14, 2007
    #4
  5. Re: How can i automatically find all unhandled exceptions in my javacode?

    Hi,

    Eric Sosman wrote:
    > upsa wrote:
    >> see subj,
    >> Thanks.

    > See sig.


    The problem is that you do not get uncaught RuntimeExceptions as Stefan
    more or less mentioned. So, IMHO the correct answer would be:

    "Read the error messages from javac and catch RuntimeExceptions in your
    main-method."

    Ciao,
    Ingo
    Ingo R. Homann, Mar 14, 2007
    #5
  6. Re: How can i automatically find all unhandled exceptions in my javacode?

    upsa schreef:
    > On 14 мар, 02:48, -berlin.de (Stefan Ram) wrote:
    >> Eric Sosman <> writes:
    >>>> see subj,
    >>> See sig.

    >> See >X-Readme< header.

    >
    > What did you mean ?


    He meant that you should see the X-Readme header. Do a search for
    ‘email headers’.

    H.
    --
    Hendrik Maryns
    http://tcl.sfs.uni-tuebingen.de/~hendrik/
    ==================
    http://aouw.org
    Ask smart questions, get good answers:
    http://www.catb.org/~esr/faqs/smart-questions.html
    Hendrik Maryns, Mar 14, 2007
    #6
  7. Re: How can i automatically find all unhandled exceptions in my javacode?

    Hi,

    >>>>>see subj,
    >>>>See sig.
    >>> See >X-Readme< header.

    >>What did you mean ?

    > He meant that you should see the X-Readme header. Do a search for
    > ‘email headers’.


    OMG (=Oh my god)!

    What kind of nerd humor is it to express onself intentionally baffling
    and not even respond in an understandable way if the OP exlicitely asks
    for it? (IMHO it is the same kind of behaviour that we nerds make fun of
    if e.g. a manager or salesman does so).

    To upsa:
    Eric meant: "Read the error messages from javac."
    Stefan meant: "But wouldn't this apply only to the checked exceptions,
    not to runtime exceptions."

    Ciao,
    Ingo
    Ingo R. Homann, Mar 14, 2007
    #7
  8. upsa

    Alex Hunsley Guest

    Re: How can i automatically find all unhandled exceptions in my javacode?

    Ingo R. Homann wrote:
    > Hi,
    >
    >>>>>> see subj,
    >>>>> See sig.
    >>>> See >X-Readme< header.
    >>> What did you mean ?

    >> He meant that you should see the X-Readme header. Do a search for
    >> ‘email headers’.

    >
    > OMG (=Oh my god)!
    >
    > What kind of nerd humor is it to express onself intentionally baffling
    > and not even respond in an understandable way if the OP exlicitely asks
    > for it? (IMHO it is the same kind of behaviour that we nerds make fun of
    > if e.g. a manager or salesman does so).


    They are chastising/needling the OP in a round-about way for not putting
    the question where it is most important to have it: the message body.

    >
    > To upsa:
    > Eric meant: "Read the error messages from javac."
    > Stefan meant: "But wouldn't this apply only to the checked exceptions,
    > not to runtime exceptions."
    >
    > Ciao,
    > Ingo
    >
    Alex Hunsley, Mar 14, 2007
    #8
  9. Re: How can i automatically find all unhandled exceptions in my javacode?

    Hi,

    Alex Hunsley wrote:
    > They are chastising/needling the OP in a round-about way for not putting
    > the question where it is most important to have it: the message body.


    I think the question (short and exact) is put perfectly where it should
    be - in the subject. Of course, one could argue about if it would be a
    good idea to copy&paste to the body. (Although I do not think that it is
    worth arguing about that.)

    Having said this: If they have the oppinion that the OP should put the
    question in the message body, they should say that - especially when he
    asks for explaining what they meant. I don't think that the OP can read
    their minds. He will only think "What ... nerds!"

    Ciao,
    Ingo
    Ingo R. Homann, Mar 14, 2007
    #9
  10. upsa

    Alex Hunsley Guest

    Re: How can i automatically find all unhandled exceptions in my javacode?

    Ingo R. Homann wrote:
    > Hi,
    >
    > Alex Hunsley wrote:
    >> They are chastising/needling the OP in a round-about way for not
    >> putting the question where it is most important to have it: the
    >> message body.

    >
    > I think the question (short and exact) is put perfectly where it should
    > be - in the subject.


    It's just netiquette, I believe, that you should always have a
    containing actual content rather than an empty one or one that says "see
    subject".

    > Of course, one could argue about if it would be a
    > good idea to copy&paste to the body. (Although I do not think that it is
    > worth arguing about that.)


    A succinct and direct question is good as a subject line. Personally I
    think it should be pasted as the body too, even if it is only the same
    content as the subject line.

    > Having said this: If they have the oppinion that the OP should put the
    > question in the message body, they should say that - especially when he
    > asks for explaining what they meant. I don't think that the OP can read
    > their minds. He will only think "What ... nerds!"


    It would be more helpful to have done that, yes.
    Alex Hunsley, Mar 14, 2007
    #10
  11. upsa

    Guest

    On Mar 14, 8:40 am, Eric Sosman <> wrote:
    > upsa wrote:
    > > see subj,
    > > Thanks.

    >
    > See sig.
    > --
    > Eric Sosman
    >
    > Read the error messages from javac.


    I wasn't able to understand automatically.

    Next time I suggest you shall write some content in main message even
    if it is same as the title.
    , Mar 15, 2007
    #11
  12. upsa

    Lew Guest

    Re: How can i automatically find all unhandled exceptions in my javacode?

    Alex Hunsley wrote:
    >>> They are chastising/needling the OP in a round-about way for not
    >>> putting the question where it is most important to have it: the
    >>> message body.


    Ingo R. Homann wrote:
    >> Having said this: If they have the oppinion that the OP should put the
    >> question in the message body, they should say that - especially when
    >> he asks for explaining what they meant. I don't think that the OP can
    >> read their minds. He will only think "What ... nerds!"


    Alex Hunsley wrote:
    > It would be more helpful to have done that, yes.


    But far less clever.

    And needling does not violate netiquette.

    And when the OP rises to the level where they appreciate the needling, then
    they will have transformed more than if they were given the easy way.

    -- Lew
    Lew, Mar 15, 2007
    #12
  13. upsa

    Oliver Wong Guest

    "Stefan Ram" <-berlin.de> wrote in message
    news:-berlin.de...
    > Eric Sosman <> writes:
    >>>see subj,

    >>See sig.

    >
    > See »X-Readme« header.
    >


    (I wonder if this reply post will replicate your X-Readme header or not --
    I suspect not)

    Right, as Stefan says, Eric's solution of reading the javac error
    messages would only apply to checked exceptions. To handled unchecked
    exceptions, you might be able to do a bit of static analysis on the source
    code, but I suspect that in general the problem is insoluble. For example,
    what if you write a ClassLoader which generates random (but legal)
    bytecode? It may generate code which throws a runtime exception without
    declaring so in the method header, and you'd have a tough time "finding"
    this unhandled exception (how would you define "find" in this case?) via
    static analysis.

    - Oliver
    Oliver Wong, Mar 19, 2007
    #13
    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. terry

    Unhandled Exceptions & Framesets

    terry, Jul 2, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    426
    Bassel Tabbara [MSFT]
    Jul 3, 2003
  2. Replies:
    1
    Views:
    397
    Darren Kopp
    Mar 7, 2006
  3. Alan Silver

    How do I catch unhandled exceptions

    Alan Silver, Mar 20, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    1,726
    Alan Silver
    Mar 23, 2006
  4. Winista

    Unhandled Exceptions thrown

    Winista, Mar 22, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    399
    Winista
    Mar 22, 2006
  5. Warren Tang
    Replies:
    1
    Views:
    875
    Warren Tang
    Sep 23, 2008
Loading...

Share This Page