What methods should go into a java.util.Objects class in JDK 7?

Joseph D. Darcy Joe.Darcy at Sun.COM
Thu Sep 10 15:58:42 UTC 2009

Mike Morris wrote:
> Joe Darcy wrote:
>> For JDK 7, I think it is high-time the platform included a class like 
>> java.util.Objects to hold commonly-written utility methods.  For 
> ...
>> What other utility methods would have broad enough use and 
>> applicability to go into a common java.util class?
> Ah! Let's just go back to coding in C, then. I cannot see any 
> justification for everything and the kitchen-sink being glommed into 
> the Java APIs. If people want these sort of static methods, they're 
> pretty-much all available in other libraries (Apache Commons, etc.)

The methods being discussed are generaly short and while easy to write, 
all of them aren't so easy to write that they cannot have bugs.  To me, 
the existence of these methods in multiple other libraries argues for 
putting robust version of them in the JDK since it is not worthwhile 
adding a library dependency just to get a static two argument equals method.


More information about the core-libs-dev mailing list