Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8DBB510859 for ; Mon, 14 Oct 2013 18:36:35 +0000 (UTC) Received: (qmail 29301 invoked by uid 500); 14 Oct 2013 18:36:33 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 29223 invoked by uid 500); 14 Oct 2013 18:36:33 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 29215 invoked by uid 99); 14 Oct 2013 18:36:33 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 18:36:33 +0000 Received: from localhost (HELO mail-wi0-f182.google.com) (127.0.0.1) (smtp-auth username britter, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 18:36:33 +0000 Received: by mail-wi0-f182.google.com with SMTP id ez12so1604356wid.3 for ; Mon, 14 Oct 2013 11:36:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=3AQTQLsQlToL2Zn6+gfVfOSa6Nig47hFOsmr15rSNwY=; b=FqyTdNVekftLUXdgvHrC4Ou4+4N/+4RHGnzl5afwUhG3deHetQAfDSPFDLxAvehob8 fFzolN/HZl01TCRahs62c1H+E2kkp1nSV+M8HfIF5Ni2wG0ar07lyVFDqwDFrupbcF3z IQv5j2JpfrBf5pp1fOzqwgrcjYsmM+SVUf12LB8MkXICZ/xCk1jHPr9uq/FICAkBhVgm vQfZB5pNAlveJp5bqJK5REsBQ6KFvywFmeAt5PGjmn24LerBfu1X+YWLiqxTW1/+sDX6 DmGQndEMtk+T4dUKD8sdbQ9fVebZFqaB1JzN+AVy1MS9vO+YEqaiZWHE8u8Ra9AnsWRU bM8w== MIME-Version: 1.0 X-Received: by 10.194.77.167 with SMTP id t7mr30572751wjw.27.1381775791261; Mon, 14 Oct 2013 11:36:31 -0700 (PDT) Received: by 10.194.190.136 with HTTP; Mon, 14 Oct 2013 11:36:31 -0700 (PDT) In-Reply-To: References: <20131014181540.1FED62388868@eris.apache.org> Date: Mon, 14 Oct 2013 20:36:31 +0200 Message-ID: Subject: Re: svn commit: r1532011 - in /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3: ArrayUtils.java ObjectUtils.java From: Benedikt Ritter To: Commons Developers List Content-Type: multipart/alternative; boundary=047d7bf0d6283290da04e8b7bf41 --047d7bf0d6283290da04e8b7bf41 Content-Type: text/plain; charset=ISO-8859-1 Hi Matt, (fired the last one without adding my comment :-) 2013/10/14 Benedikt Ritter > > > > 2013/10/14 Matt Benson > >> Hi Benedikt, see inline: >> >> >> On Mon, Oct 14, 2013 at 1:15 PM, wrote: >> >> > Author: britter >> > Date: Mon Oct 14 18:15:39 2013 >> > New Revision: 1532011 >> > >> > URL: http://svn.apache.org/r1532011 >> > Log: >> > Deprecate methods that are available in Java 7's java.lang.Objects >> > >> > Modified: >> > >> > >> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java >> > >> > >> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java >> > >> > Modified: >> > >> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java >> > URL: >> > >> http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java?rev=1532011&r1=1532010&r2=1532011&view=diff >> > >> > >> ============================================================================== >> > --- >> > >> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java >> > (original) >> > +++ >> > >> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java >> > Mon Oct 14 18:15:39 2013 >> > @@ -199,6 +199,8 @@ public class ArrayUtils { >> > * @param array1 the left hand array to compare, may be {@code >> null} >> > * @param array2 the right hand array to compare, may be {@code >> null} >> > * @return {@code true} if the arrays are equal >> > + * @deprecated this method has been replaced by {@code >> > java.util.Objects.deepEquals(Object, Object)} and will be >> > + * removed from future releases. >> > */ >> > public static boolean isEquals(final Object array1, final Object >> > array2) { >> > return new EqualsBuilder().append(array1, array2).isEquals(); >> > >> > Modified: >> > >> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java >> > URL: >> > >> http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java?rev=1532011&r1=1532010&r2=1532011&view=diff >> > >> > >> ============================================================================== >> > --- >> > >> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java >> > (original) >> > +++ >> > >> commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java >> > Mon Oct 14 18:15:39 2013 >> > @@ -149,6 +149,8 @@ public class ObjectUtils { >> > * @param object1 the first object, may be {@code null} >> > * @param object2 the second object, may be {@code null} >> > * @return {@code true} if the values of both objects are the same >> > + * @deprecated this method has been replaces by {@code >> > java.util.Objects.equals(Object, Object)} in Java 7 and will >> > + * be removed from future releases. >> > */ >> > public static boolean equals(final Object object1, final Object >> > object2) { >> > if (object1 == object2) { >> > @@ -195,6 +197,8 @@ public class ObjectUtils { >> > * @param obj the object to obtain the hash code of, may be {@code >> > null} >> > * @return the hash code of the object, or zero if null >> > * @since 2.1 >> > + * @deprecated this method has been replaced by {@code >> > java.util.Objects.hashCode(Object)} in Java 7 and will be >> > + * removed in future releases >> > */ >> > public static int hashCode(final Object obj) { >> > // hashCode(Object) retained for performance, as hash code is >> > often critical >> > @@ -220,6 +224,8 @@ public class ObjectUtils { >> > * @param objects the objects to obtain the hash code of, may be >> > {@code null} >> > * @return the hash code of the objects, or zero if null >> > * @since 3.0 >> > + * @deprecated this method has been replaced by {@code >> > java.util.Objects.hash(Object...)} in Java 7 an will be >> > + * removed in future releases. >> > */ >> > public static int hashCodeMulti(final Object... objects) { >> > int hash = 1; >> > @@ -373,6 +379,9 @@ public class ObjectUtils { >> > * @param obj the Object to {@code toString}, may be null >> > * @return the passed in Object's toString, or {@code ""} if {@code >> > null} input >> > * @since 2.0 >> > + * @deprecated this method has been replaces by {@code >> > java.util.Objects.toString(Object)} in Java 7 and will be >> > + * removed in future releases. Note however that said method will >> > return "null" for null references, while this >> > + * method returns and empty String. To preserve behavior use {@code >> > java.util.Objects.toString(myObject, "")} >> > >> >> My preference here would be to begin providing >> ObjectUtils#defaultString(Object) with the existing "", intended to >> survive >> beyond the removal of ObjectUtils.toString(). This will: >> * preserve the users' ability to call a method that implicitly uses "" >> * reduce confusion with Objects.toString(), and >> * enforce mnemonic retention by using the same terminology/behavior as >> StringUtils#defaultString() >> >> I'd welcome assenting or dissenting opinions here from other committers >> and >> users. >> > Makes sense to me. So if nobody objects, feel free to change it like that. > >> Matt >> >> >> > */ >> > public static String toString(final Object obj) { >> > return obj == null ? "" : obj.toString(); >> > @@ -396,6 +405,8 @@ public class ObjectUtils { >> > * @param nullStr the String to return if {@code null} input, may >> be >> > null >> > * @return the passed in Object's toString, or {@code nullStr} if >> > {@code null} input >> > * @since 2.0 >> > + * @deprecated this method has been replaces by {@code >> > java.util.Objects.toString(Object, String)} in Java 7 and >> > + * will be removed in future releases. >> > */ >> > public static String toString(final Object obj, final String >> nullStr) >> > { >> > return obj == null ? nullStr : obj.toString(); >> > >> > >> > >> > > -- http://people.apache.org/~britter/ http://www.systemoutprintln.de/ http://twitter.com/BenediktRitter http://github.com/britter --047d7bf0d6283290da04e8b7bf41--