commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <>
Subject RE: [lang] ObjectUtils.toString(Object) should not be deprecated
Date Fri, 21 Feb 2014 02:25:15 GMT
I think you have a point. 


-------- Original message --------
From: Christoph Schneegans <> 
Date:02/20/2014  20:45  (GMT-05:00) 
Subject: [lang] ObjectUtils.toString(Object) should not be deprecated 

Hello there!

I have been using the Commons Lang library for about two years, but this 
is my first post to the mailing list.

Starting with release 3.2, ObjectUtils.toString(Object) was deprecated in 
favour of java.util.Objects.toString(Object), see

As the Javadoc comment correctly points out, to preserve the current 
behavior, one cannot simply replace ObjectUtils.toString(foo) with 
Objects.toString(foo), but would need to call Objects.toString(foo, ""), 
which is less concise and less readable.

I agree that other methods in ObjectUtils, namely
  - toString(Object, String)
  - equals(Object, Object)
  - hashCode(Object)
  - hashCodeMulti(Object...)
are now superfluous and rightfully deprecated, but why deprecate a useful 
method when there is no direct substitute?



To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message