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 ABC9F7B8F for ; Wed, 14 Sep 2011 20:07:11 +0000 (UTC) Received: (qmail 4876 invoked by uid 500); 14 Sep 2011 20:07:11 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 4790 invoked by uid 500); 14 Sep 2011 20:07:11 -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 4780 invoked by uid 99); 14 Sep 2011 20:07:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Sep 2011 20:07:10 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simone.tripodi@gmail.com designates 209.85.161.175 as permitted sender) Received: from [209.85.161.175] (HELO mail-gx0-f175.google.com) (209.85.161.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Sep 2011 20:07:05 +0000 Received: by gxk4 with SMTP id 4so2266964gxk.6 for ; Wed, 14 Sep 2011 13:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=/SqUdh8c8cUoDmX1KnEAqa/t8dryvvECHjL3/ndFvFs=; b=ami+2rEWTcAW26sTjjtGENRqeH8JHxe0ZwbK7YbF075dOJ8ypf3JA1dkBhx7J5cYl1 vx6xofflwLYG2uPvdeidv7DxfxtL71/77GM1+eadOznhBH2yQFlEy3OMjrv7hsk10pRp /oJhiVzVqR8yad8aVU8WGrxFOlamU9mUmTidw= MIME-Version: 1.0 Received: by 10.150.99.7 with SMTP id w7mr426854ybb.111.1316030804817; Wed, 14 Sep 2011 13:06:44 -0700 (PDT) Sender: simone.tripodi@gmail.com Received: by 10.151.49.3 with HTTP; Wed, 14 Sep 2011 13:06:44 -0700 (PDT) In-Reply-To: References: <20110914193437.618732388AF0@eris.apache.org> Date: Wed, 14 Sep 2011 22:06:44 +0200 X-Google-Sender-Auth: 8ZRhV707FrGbnDlxVTeakahRoLg Message-ID: Subject: Re: svn commit: r1170805 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.java From: Simone Tripodi To: Commons Developers List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable we already discussed about it, and choose the option to let users extend the classes for 2 reasons: - be reused inside IoC/DI containers that create dynamic proxies - specialize classes with generic types (class MyTransformedBinaryProcedure extends TransformedBinaryProcedure) yes, checkstyle complains about those violations[1] anyways, every suggestion is more than welcome! Simo [1] http://commons.apache.org/sandbox/functor/checkstyle.html http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Wed, Sep 14, 2011 at 9:42 PM, sebb wrote: > On 14 September 2011 20:34, =C2=A0 wrote: >> Author: simonetripodi >> Date: Wed Sep 14 19:34:37 2011 >> New Revision: 1170805 >> >> URL: http://svn.apache.org/viewvc?rev=3D1170805&view=3Drev >> Log: >> fixed checkstyle violation: Method 'hashCode' is not designed for extens= ion - needs to be abstract, final or empty > > Is the class intended for extension? > If so, and you add fields, you won't be able to override hashCode to > take account of them. > If not, just make the class final. > > Are you sure that the Checkstyle complaint is valid here? > >> Modified: >> =C2=A0 =C2=A0commons/sandbox/functor/trunk/src/main/java/org/apache/comm= ons/functor/core/composite/TransformedBinaryProcedure.java >> >> Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons= /functor/core/composite/TransformedBinaryProcedure.java >> URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main= /java/org/apache/commons/functor/core/composite/TransformedBinaryProcedure.= java?rev=3D1170805&r1=3D1170804&r2=3D1170805&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/funct= or/core/composite/TransformedBinaryProcedure.java (original) >> +++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/funct= or/core/composite/TransformedBinaryProcedure.java Wed Sep 14 19:34:37 2011 >> @@ -107,7 +107,7 @@ public class TransformedBinaryProcedure< >> =C2=A0 =C2=A0 =C2=A0* {@inheritDoc} >> =C2=A0 =C2=A0 =C2=A0*/ >> =C2=A0 =C2=A0 @Override >> - =C2=A0 =C2=A0public int hashCode() { >> + =C2=A0 =C2=A0public final int hashCode() { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 int result =3D "TransformedBinaryProcedure".= hashCode(); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 result <<=3D 2; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 result |=3D helper.procedure.hashCode(); >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org