Flumble wrote:You, sir, name? wrote:EvanED wrote:Pretty sure I've posted this before, but my absolute favorite DailyWTF is this "false detector":Spoiler:
Code: Select all
public boolean checkFalse(Boolean bool)
if (bool.booleanValue() == Boolean.FALSE.booleanValue())
This is is like an onion of WTFs.
That's not right... that's not even wrong.
But it is. It doesn't check for null!
I think NPE:ing on checkFalse(null) is about the best error handling you can hope for with a function prototype like that. Of course passing null in the first place is arguably more wrong than how the function handles it.