What methods should go into a java.util.Objects class in JDK 7?
scolebourne at joda.org
Mon Nov 16 08:44:44 UTC 2009
2009/11/16 Martin Buchholz <martinrb at google.com>:
> On Sun, Nov 15, 2009 at 16:47, Rémi Forax <forax at univ-mlv.fr> wrote:
>> Do you want to say something like "I need a closure here" :)
> No. I need a macro here! (But not a C-style one)
No, what you need is the Elvis null-safe operator ?: But then that
was rejected wasn't it...
Now, we have more objections against the method that was proposed to
be used when the operator was rejected. It would be funny if it wasn't
As I've said before, nulls are everywhere in real code. Absolutely
everywhere. And they cause so many problems in real, production code
that they should be top of the list of issues that should be
In this specific case, the question was "why include it when you can
use a?b:c". Well, I've seen resistance by developers to that language
feature, and I know some places outright block it in coding standards.
For many, a method call is preferred, and "overhead" isn't what
More information about the core-libs-dev