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 0CEC3CF60 for ; Thu, 10 May 2012 19:44:36 +0000 (UTC) Received: (qmail 35482 invoked by uid 500); 10 May 2012 19:44:35 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 35380 invoked by uid 500); 10 May 2012 19:44:35 -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 35372 invoked by uid 99); 10 May 2012 19:44:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 19:44:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gudnabrsam@gmail.com designates 209.85.212.43 as permitted sender) Received: from [209.85.212.43] (HELO mail-vb0-f43.google.com) (209.85.212.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 19:44:29 +0000 Received: by vbbfq11 with SMTP id fq11so2440743vbb.30 for ; Thu, 10 May 2012 12:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=8r4f9V1BWoBitprrgvPUjKjsmcYuHkX5KPFc18MyYlM=; b=hnw34cWXQ4LBZIcFm14gY62X90eFG7Db7ggMNJ/vm7q1rXvS1MUoq3O/BJ6I1cyQE5 6kUnelrjOcIB2o7m0Xy4brH6rZ3s0HYs7CW+2VtSgCYB8kjxPX13k9lyiQUjxK7mQQiP XNJnZJUj3/Q2ohlFHgtHFiqKvtDLsY76bfVP2IEivqgligl8DyOGff+lkTMniLyfDlH9 Chcib9Cy7La8L1wacKei9Y/KW1cSntdVSose5JmPtve5vmzdYzUE3Gj+LseVUL9OlYr6 4sxCLaVZMDdRUKbuS9b9v8Ji6RSQdvFvenRHxM/Aeb0AEkKDtu+kxHcmjG0Bxj1cvPV2 H5TQ== MIME-Version: 1.0 Received: by 10.52.70.209 with SMTP id o17mr2700146vdu.11.1336679048206; Thu, 10 May 2012 12:44:08 -0700 (PDT) Received: by 10.52.30.18 with HTTP; Thu, 10 May 2012 12:44:08 -0700 (PDT) Reply-To: gudnabrsam@gmail.com In-Reply-To: <1336676940.74287.YahooMailNeo@web161205.mail.bf1.yahoo.com> References: <1336674453.81058.YahooMailNeo@web161202.mail.bf1.yahoo.com> <1336676940.74287.YahooMailNeo@web161205.mail.bf1.yahoo.com> Date: Thu, 10 May 2012 14:44:08 -0500 Message-ID: Subject: Re: [functor] Remove duplicated equals() methods From: Matt Benson To: "Bruno P. Kinoshita" Cc: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, May 10, 2012 at 2:09 PM, Bruno P. Kinoshita wrote: > On 05/10/2012 03:38 PM, Matt Benson wrote: >> On Thu, May 10, 2012 at 1:27 PM, Bruno P. Kinoshita >> =A0wrote: >>> Hi all, >>> >>> While I am still trying to find time to work on a proposal for enhancem= ents in the generators API in [functor] (https://issues.apache.org/jira/bro= wse/FUNCTOR-14), I'm reviewing other pending issues, including the one rega= rding test coverage. >>> >>> The comparators API seemed to be lacking tests for some decision branch= es. But looking closely at the code, I realized that there were two equals = code in some comparator functors. Then I set up a Sonar instance to scan th= e code, and found that it is common in many other parts of the code (http:/= /66.228.56.222/sonar/drilldown/violations/org.apache.commons:commons-functo= r?severity=3DCRITICAL). >>> >>> Does anybody know if there is some reason for having both equals(Object= that) and equals(SomeFunctor =A0that)? I think we could merge both meth= ods in only one. The Generators in [functor] have only one equals() method,= and compares against this, uses instanceof, etc. I had a quick look on [ma= th3] and [lang3], and looks like they both use only one equals() method, co= mpares against this, uses instaceof, etc. >>> >>> If there is no objection here, I could create a patch for this in Jira,= merging both equals() methods in one :-) Then after this I will proceed wr= iting tests to increase the test coverage (https://issues.apache.org/jira/b= rowse/FUNCTOR-12). >>> >> >> Bruno, >> =A0 =A0As far as I know this pattern was introduced by one of [functor]'= s >> original authors and must simply have been his preference. =A0Personally >> I agree that this is not what your average Java developer probably >> expects to see in your average Java codebase, and would support >> combining these methods. =A0This is documented at [1] and filed at [2] >> (where your earlier comment is valid, and is also mentioned at [1], >> but doesn't IMHO pertain specifically to this JIRA issue). >> >> Regards, >> Matt >> >> [1] http://wiki.apache.org/commons/Sanity%20Check%20of%20APIs%2C%20etc. >> [2] https://issues.apache.org/jira/browse/FUNCTOR-11 >> >>> Thanks in advance! >>> >>> Bruno P. Kinoshita >>> http://kinoshita.eti.br >>> http://tupilabs.com >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>> > > Hi Matt, > > Thanks for your speedy reply and for sending me the links. > > You are right indeed, there is already an issue filled for this, and my c= omment is not pertinent to that issue :-) > > The comment in question refers to the item "- why are equals, hashCode an= d toString defined in the Functor interface?" from [1]. Maybe we should cre= ate a separate issue for that, WDYT? I'm not necessarily of the opinion that this is wrong, hence my comment that a [VOTE] or [POLL] would IMHO be more appropriate than a JIRA issue at this time. Your JIRA comment mentions the example of java.util.Map, and given that I can also cite java.lang.annotation.Annotation. In light of these I would be inclined to vote in favor of letting these javadoc-hosting method declarations remain, unless someone comes along with a convincing argument. > > I will use FUNCTOR-11 to attach my patch combining the equals() methods. > > Regarding the Sanity Check Wiki entry, do you think we should add "Remove= @author tags" too? I believe it has been decided in Apache Commons to stop= using this tag (I can't remember if it is only the @author tag, or there a= re other tags too). +1 here to simply open a JIRA issue, no need to discuss in the wiki. > > BTW, I filled another issue=A0[2]=A0today with a patch that fixes some mi= nor checkstyle errors in [functor]. > > Thanks again! Thank you! Matt > > -- > Bruno P. Kinoshita > http://www.kinoshita.eti.br > http://www.tupilabs.com > > [1] http://wiki.apache.org/commons/Sanity%20Check%20of%20APIs%2C%20etc. > [2]=A0https://issues.apache.org/jira/browse/FUNCTOR-16 > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org