Objects.toString [Re: What methods should go into a java.util.Objects class in JDK 7?]

Joseph D. Darcy Joe.Darcy at Sun.COM
Thu Oct 8 18:14:18 UTC 2009


Paul Benedict wrote:
> Joe,
>
>   
>> I'm preparing the first round of java.util.Objects with the
>> single-argument static toString method return "null" for null for final
>> review.
>>     
>
> Why would you choose to return "null" for any null object? 

Because that is how the platform has always treated null in string 
concatenation.

> Everyone
> who has opined did disagree with replicating String.valueOf()
> behavior. 

The people who disagreed with the replication disagreed with the 
replication.  Others disagreed with the behavior.

-Joe



More information about the core-libs-dev mailing list