• Strif (unregistered)

    Is that right?

  • (nodebb) in reply to Strif

    No, left.

    I wonder why those guys left out to check for such important cases as

    "YES", "NO", "YUP", "NOPE", "NEVER_EVER", "FILENOTFOUND", "POSITIVE", "NEGATIVE", "MAYBE", "SHOULD" and all that other stuff in https://www.ietf.org/rfc/rfc2119.txt

    Addendum 2016-07-11 07:59: And what about SchrΓΆdinger's booleans, anyway?

  • Anonymous Coward (unregistered)

    Using Vector in a version of Java new enough to support generics is TRWTF

  • Andrew (unregistered)

    Unless the last one is a try/catch Java formality (where the catch is only ever going to run in event of FUBAR), I can see an inevitable null pointer exception.

  • Irritable Bowel Syndrome (unregistered) in reply to Andrew

    In fact, that code will fail to compile with "variable a might not have been initialized".

    But, yeah, there's no need for that exception. It's not generic, so there's no chance of heap pollution, it's not an array so there's no chance of an ArrayStoreException, and there's no boxing or unboxing. (JLS 5.2)

    TRWTF is that "a = b" can fail in Java...

  • I dunno LOL ¯\(°_o)/¯ (unregistered)

    if (a.equalsIgnoreCase("MAYBE") && (rand() & 1)) { // do something }

  • Matt Westwood (unregistered)

    What on earth is going on? The code you have posted up appears to be suboptimal. I believe that if I were to get my man Rajesh on the case, he'd be able to come up with something better than this. Come on guys, pull your socks up.

  • BLAKEYRAT (unregistered)

    LolL this is gr8 this website SUXX so much it gets like 2 reader a day LOL!

  • (nodebb)

    You might laugh, but this is how you code against race conditions! Bravo!

  • Anonymous (unregistered) in reply to BLAKEYRAT

    πŸ’―πŸ’―πŸ’―πŸ˜‚πŸ˜‚πŸ”₯πŸ”₯πŸ”₯πŸ”₯ lit fam πŸ˜‚πŸ˜‚πŸ”₯πŸ’―πŸ˜‚

  • Nate Scherer (google) in reply to Irritable Bowel Syndrome

    "TRWTF is that "a = b" can fail in Java..."

    It can't. That is almost certainly a typo and should have been domainObject = getDomainObject();

  • Richard (unregistered) in reply to Nate Scherer

    That's wrong:

    public static void fail(Integer a) { int b = a; if (b == 3) { System.out.println("Success"); } }

    fails with a NullpointerException when a null value is passed as argument.

Leave a comment on “Hanging By a String”

Log In or post as a guest

Replying to comment #:

« Return to Article