Hello.

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
example, a two-argument static equals method that returned true if both arguments are null, returns false is one argument is null, and otherwise
returns the result of calling arg1.equals(arg2)  (6797535 "Add shared
two argument static equals method to the platform").

A static hashCode method returning 0 for null and the value of
arg.hashCode() has also been suggested.

A set of

    static int compareTo(int, int)
    static int compareTo(long, long)
    ....

methods probably belongs somewhere in the platform too.

What other utility methods would have broad enough use and applicability
to go into a common java.util class?

-Joe
Hi,

As a note, I've just put up an article about this on InfoQ soliciting feedback from the wider Java community:

http://www.infoq.com/news/2009/09/jdk7-java-utils-object

Thanks,

Ryan Slobojan

Reply via email to