- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best ofβ¦
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Is that right?
Admin
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?
Admin
Using Vector in a version of Java new enough to support generics is TRWTF
Admin
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.
Admin
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...
Admin
if (a.equalsIgnoreCase("MAYBE") && (rand() & 1)) { // do something }
Admin
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.
Admin
LolL this is gr8 this website SUXX so much it gets like 2 reader a day LOL!
Admin
You might laugh, but this is how you code against race conditions! Bravo!
Admin
π―π―π―πππ₯π₯π₯π₯ lit fam πππ₯π―π
Admin
"TRWTF is that "a = b" can fail in Java..."
It can't. That is almost certainly a typo and should have been domainObject = getDomainObject();
Admin
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.