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

2009-10-09 Thread Joseph D. Darcy
Eamonn McManus wrote: David Holmes - Sun Microsystems wrote: > So to me: String toString(Object o, String useIfNull) is the only method > that provides true utility in this case. I agree with that, and would just suggest to the person specifying the method to add a @see String#valueOf(Object)

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

2009-10-09 Thread Eamonn McManus
David Holmes - Sun Microsystems wrote: > So to me: String toString(Object o, String useIfNull) is the only method > that provides true utility in this case. I agree with that, and would just suggest to the person specifying the method to add a @see String#valueOf(Object). I find that the behavio

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

2009-10-09 Thread Ulf Zibis
Am 09.10.2009 01:53, David Holmes - Sun Microsystems schrieb: So to me: String toString(Object o, String useIfNull) is the only method that provides true utility in this case. I can follow this argumentation. +1 -Ulf

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

2009-10-08 Thread David Holmes - Sun Microsystems
Joe, Joseph D. Darcy said the following on 10/09/09 04:30: System.out.println("" + referenceOfAnyType); will print "null" if referenceOfAnyType is null. This is what the platform has done since the beginning. Yes because String concatenation can not tolerate null values appearing, so it is

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

2009-10-08 Thread Paul Benedict
Joe, I understand your point, and that's why I countered with my String and StringBuilder points. Those two classes are used underneath the covers for inline concatenation, but, again, java.util.Objects has grander intentions than string concatenation. This class is for all objects, and however St

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

2009-10-08 Thread Jason Mehrens
ors are useful. Jason > Date: Thu, 8 Oct 2009 10:51:50 -0700 > From: joe.da...@sun.com > Subject: Re: Objects.toString [Re: What methods should go into a > java.util.Objects class in JDK 7?] > To: jason_mehr...@hotmail.com > CC: core-libs-dev@openjdk.java.net > I'm

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

2009-10-08 Thread Joseph D. Darcy
Paul Benedict wrote: Why would you choose to return "null" for any null object? Because that is how the platform has always treated null in string concatenation. If you were defining new operations for String, StringBuilder, or StringBuffer, I would agree with your choice. Since yo

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

2009-10-08 Thread Paul Benedict
>> Why would you choose to return "null" for any null object? > > Because that is how the platform has always treated null in string > concatenation. If you were defining new operations for String, StringBuilder, or StringBuffer, I would agree with your choice. Since you are now defining a global

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

2009-10-08 Thread Joseph D. Darcy
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

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

2009-10-08 Thread Paul Benedict
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'

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

2009-10-08 Thread Joseph D. Darcy
27;t see what connection there is between Jigsaw and j.u.Objects. -Joe Jason > Date: Thu, 8 Oct 2009 11:47:49 +0100 > Subject: Objects.toString [Re: What methods should go into a java.util.Objects class in JDK 7?] > From: scolebou...@joda.org > To: core-libs-dev@openjdk.java

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

2009-10-08 Thread Jason Mehrens
: What methods should go into a > java.util.Objects class in JDK 7?] > From: scolebou...@joda.org > To: core-libs-dev@openjdk.java.net > > A number of us are proposing that Objects.toString(obj) should return > "" when the object is null. I'm strongly in favour of t

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

2009-10-08 Thread Paul Benedict
+1 for me. +1 also for having the overloaded version that can accept a fallback string. Paul

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

2009-10-08 Thread Ulf Zibis
+1 or drop Objects.toString(obj) completely. -Ulf Am 08.10.2009 12:47, Stephen Colebourne schrieb: 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 somet

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

2009-10-08 Thread Stephen Colebourne
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 : > Davi