Code review: 7012540 (java.util.Objects.nonNull() incorrectly named) (original) (raw)

Bob Lee crazybob at crazybob.org
Thu Jan 27 01:20:14 UTC 2011


On Wed, Jan 26, 2011 at 3:44 PM, Joshua Bloch <jjb at google.com> wrote:

I like the name nonNull. All other things being equal, shorter is better. I've used the name nonNull for a few years, and it's feels right. To my mind, requireNonNull does a worse job of suggesting that the method returns its argument.

+1 for nonNull. While it's implemented as a method, I think of it more as a keyword-like modifier, in which case an adjective works better than a verb phrase.

Bob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20110126/93b06da5/attachment.html>



More information about the core-libs-dev mailing list