Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 83194 invoked from network); 15 Oct 2009 12:24:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Oct 2009 12:24:58 -0000 Received: (qmail 40881 invoked by uid 500); 15 Oct 2009 12:24:57 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 40760 invoked by uid 500); 15 Oct 2009 12:24:57 -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 40750 invoked by uid 99); 15 Oct 2009 12:24:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Oct 2009 12:24:57 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of goran.hacek@gmail.com designates 209.85.220.213 as permitted sender) Received: from [209.85.220.213] (HELO mail-fx0-f213.google.com) (209.85.220.213) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Oct 2009 12:24:55 +0000 Received: by fxm9 with SMTP id 9so990516fxm.25 for ; Thu, 15 Oct 2009 05:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=hqprSmkjfezdlSP3LGaOkyqaWkA/kNOlQqy6HU9kSP0=; b=nSA03pEJBjd5/oE34n6pnt22Hs0ng9CNzKOOUcSEldTuMWt7vF3vu8zYkrtQm0mXHw VOlsIWF+ZuQl+zzT2CpDWJbCY9RULdWqr4E2462wJG9ATplkYTDb5bdxZXa7ZqF+rDgI xPuYxHDGS9Hl9TNRJlvQAGcvmoA+w3NpIF9o0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KFhDQCEXFPp/Kn+BJTGsDSE8ylXxrqjgakuQ7DStPF/edIalh/aQy1KHa61IukSzNw XlHMJOvs248jWYHMLsoGvIQnG6GwlIsSQ9TOr+7/x/N0syk8JwO/u2ZGvb8sUS4dt8E4 tfT7FEIrxjBFOHg2PKad7hetHEHqioiHWM1hk= MIME-Version: 1.0 Received: by 10.223.3.137 with SMTP id 9mr2426564fan.45.1255609473823; Thu, 15 Oct 2009 05:24:33 -0700 (PDT) In-Reply-To: <542111.81077.qm@web55102.mail.re4.yahoo.com> References: <25aac9fc0910141056l2113f2d5i2eadc9f6e909cd91@mail.gmail.com> <542111.81077.qm@web55102.mail.re4.yahoo.com> Date: Thu, 15 Oct 2009 14:24:33 +0200 Message-ID: <13cbe8ea0910150524m5040dd8csbd1c3fd34a0cd87b@mail.gmail.com> Subject: Re: svn commit: r825151 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java From: Goran Hacek To: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 On Wed, Oct 14, 2009 at 19:56, sebb wrote: > Why not just remove the equals() and hashCode() methods? > The defaults are just as good. It is not the same because multiple instances of NOPClosure can exist. This is because of serialization support. By implementing readResolve() method which will always return INSTANCE static member will ensure that no more then one instance of NOPClosure exists at any given time. With this guaranty default equals() and hashCode() will do their job as they should. Javadoc comment on INSTANCE static member, which says "Singleton predicate instance", is not correct because class doesn't implement singleton pattern correctly. This would be fixed by implementing readResolve() as previously described. I have created a patch for this, it is in jira[1], so can someone review it? [1] https://issues.apache.org/jira/browse/COLLECTIONS-343 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org