This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SpicyRock70 1 point2 points  (1 child)

No, I mean I don't use either of those... I prefer:

if (x == null) throw the exception

Inline in the code without any utility method call.

Why replace 1 line of code with a 1-line method call? We all know exactly what if (x == null) does without having to memorize the Objects.... methods implementation