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

Paul Benedict pbenedict at apache.org
Thu Oct 8 18:11:01 UTC 2009


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? Everyone who has opined did disagree with replicating String.valueOf() behavior. I don't see how this behavior is appropriate for all objects: no data in should be no data (or at least empty data) going out.

Paul



More information about the core-libs-dev mailing list