Objects.toString [Re: What methods should go into a java.util.Objects class in JDK 7?]
Stephen Colebourne
scolebourne at joda.org
Thu Oct 8 10:47:49 UTC 2009
A number of us are proposing that Objects.toString(obj) should return
"" when the object is null. I'm strongly in favour of this, and it
removes any discussion of duplicated API (as it does something
different and more useful).
In favour/against +1/-1 ?
Stephen
2009/10/7 Joseph D. Darcy <Joe.Darcy at sun.com>:
> David Holmes - Sun Microsystems wrote:
>>
>> Stephen Colebourne said the following on 10/07/09 18:10:
>>>
>>> BTW, I don't accept the argument that one and only one way to do
>>> something is part of the JDK.
>>
>> While the JDK is far from a model example of providing "one way" to do
>> something, that doesn't mean we should gratuitously add superfluous and
>> redundant functionality.
>
> The JDK has a long history of providing convenience methods. For example,
> we have PrintStream.format and PrintStream.printf which are just two names
> for the same functionality.
>
>> Type.valueOf is an established pattern for converting types.
>>
>> The JDK is already severely bloated - new APIs should pay their own way.
>
> Getting rid of more than half a dozen implementations of equals(Object,
> Object) should just in the JDK should more than pay the for the entire
> Objects class ;-)
>
> -Joe
>
>
More information about the core-libs-dev
mailing list