You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Christoph Schneegans <Ch...@Schneegans.de> on 2014/02/21 02:45:06 UTC
[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
<http://commons.apache.org/proper/commons-lang/javadocs/api-3.2/org/apache/commons/lang3/ObjectUtils.html>.
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?
Regards,
Christoph
--
<http://schneegans.de/>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org