What methods should go into a java.util.Objects class in JDK 7?

Jason Mehrens jason_mehrens at hotmail.com
Wed Oct 7 16:17:20 UTC 2009


> Hi Stephen,
> 
> [...]
> > In key places there are multiple options. NIO Path vs File and 
> > Calendar vs Date are examples.
> 
> As you know, Path (resp. Calendar) is just an attempt to correct the 
> mess introduced by File (resp. Date).
> So yes, there is duplication but this duplication is done to correct a 
> wrong design.
> 
> > (Most code is written using IDEs these days, so having a predictable 
> > place to start from for autocomplete is important. Hence having 
> > equals/hashCode/compare but not toString would be very unintuitive to 
> > the Objects API).
> >
> > Stephen
> Rémi


The 2 toString variants from ObjectUtils are very handy to have for displaying values for UIs.  Perhaps those should be added to Objects to correct a wrong design (limited use) of returning "null" for null and would least provide new behavior.

Seems like the way to go unless these are going to cause more harm (confusion) than good.

 

Jason
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20091007/02be0b62/attachment.html>


More information about the core-libs-dev mailing list