you know what I really hate?

Discussion in 'Java' started by Andy Fish, Jul 16, 2004.

  1. Andy Fish

    Andy Fish Guest

    it's stuff like this:

    try {
    ...
    ...
    } catch (Exception ex) {
    System.out.println("An Exception happened");
    throw new Exception("an exception happened")
    }
     
    Andy Fish, Jul 16, 2004
    #1
    1. Advertising

  2. Andy Fish <> scribbled the following:
    > it's stuff like this:


    > try {
    > ...
    > ...
    > } catch (Exception ex) {
    > System.out.println("An Exception happened");
    > throw new Exception("an exception happened")
    > }


    I suspect it's good for debugging, but even then it could be like this:

    try {
    ...
    ...
    }
    catch (Exception ex) {
    System.out.println("An Exception happened");
    throw ex;
    }

    Note that the stack trace of an exception starts at where the exception
    object was constructed, not where it was thrown.

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
    "Hasta la Vista, Abie!"
    - Bart Simpson
     
    Joona I Palaste, Jul 16, 2004
    #2
    1. Advertising

  3. Andy Fish

    Peter Kirk Guest

    "Andy Fish" <> skrev i en meddelelse
    news:XESJc.925$...
    > it's stuff like this:
    >
    > try {
    > ...
    > ...
    > } catch (Exception ex) {
    > System.out.println("An Exception happened");
    > throw new Exception("an exception happened")
    > }


    Writing to System.out?
    Catching "Exception"?
    Catching Exception and then throwing a new Exception?
    Not logging/displaying/using the actual exception message?
    Not putting the curly braces on new lines?
    Not putting a semicolon at the end of throw new Exception?
    Dots inside a try block?

    Having a bad day?
     
    Peter Kirk, Jul 21, 2004
    #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. Jack Saalweachter

    God, software patents, I hate you, die.

    Jack Saalweachter, Oct 25, 2005, in forum: C++
    Replies:
    1
    Views:
    294
    Jack Saalweachter
    Oct 25, 2005
  2. Replies:
    30
    Views:
    996
    Arne Vajhøj
    Feb 10, 2008
  3. Geoff Vince

    Do you know what *really* annoys me?

    Geoff Vince, Aug 17, 2008, in forum: C Programming
    Replies:
    2
    Views:
    264
    Chris M. Thomasson
    Aug 18, 2008
  4. Jon

    I don't really hate soup

    Jon, Nov 1, 2010, in forum: C Programming
    Replies:
    0
    Views:
    211
  5. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    236
    Gregory Toomey
    Apr 23, 2004
Loading...

Share This Page