Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 15140 invoked from network); 17 May 2010 16:46:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 May 2010 16:46:04 -0000 Received: (qmail 95121 invoked by uid 500); 17 May 2010 16:46:04 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 95051 invoked by uid 500); 17 May 2010 16:46:03 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 95044 invoked by uid 99); 17 May 2010 16:46:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 16:46:03 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [62.179.121.31] (HELO viefep11-int.chello.at) (62.179.121.31) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 16:45:56 +0000 Received: from edge04.upcmail.net ([192.168.13.239]) by viefep11-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100517164533.JSLA4890.viefep11-int.chello.at@edge04.upcmail.net> for ; Mon, 17 May 2010 18:45:33 +0200 Received: from [192.168.1.50] ([84.74.100.246]) by edge04.upcmail.net with edge id JglY1e03k5JxopQ04glZbq; Mon, 17 May 2010 18:45:33 +0200 X-SourceIP: 84.74.100.246 Message-ID: <4BF172AC.1090703@apache.org> Date: Mon, 17 May 2010 18:45:32 +0200 From: Felix Knecht Reply-To: felixk@apache.org User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100509 Thunderbird/3.0.4 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: shared.ldap.ldif.LdifEntry.equals not logic References: <4BF1720B.6060201@otego.com> In-Reply-To: <4BF1720B.6060201@otego.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=ZDt3ILgE3VX9xkJc7+9REBIC4hFTL6V7NAq0V56QRNQ= c=1 sm=0 a=GiEJCGfGYqwA:10 a=0qYQvVkOOIcA:10 a=pXoq77xVGrQA:10 a=8nJEP1OIZ-IA:10 a=mV9VRH-2AAAA:8 a=xe8BsctaAAAA:8 a=uomd4VAZCOdFd4vw2xIA:9 a=WusvHY4UnhvDSfQJPowA:7 a=BwnwZvChjuWvmaGNpx_-Lh9HfSEA:4 a=wPNLvfGTeEIA:10 a=exNZ7x4igJwA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/17/10 18:42, Felix Knecht wrote: > Sorry, it's me again ... > > On line 764 [1] we do 'entry.getDn()' and further down 784 [2] we check > if entry==null. > This check is not necessary, because line 764 will throw a NPE in this > case what is very bad for an equals method. Maybe I'm wrong, but could > line 764 also look like > > if(getEntry()==null) return false; > DN thisDn = getEntry().getDn(); > > and then remove the if from line 784? There's a similar problem in the hashCode method (lines 672 / 686) > > > [1] > http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/ldif/LdifEntry.html#764 > [2] > http://people.apache.org/~felixk/shared-docs/xref/org/apache/directory/shared/ldap/ldif/LdifEntry.html#784 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvxcqwACgkQ2lZVCB08qHHI7ACgrw9mfB6+y6qaTC0uXJA4aeka rZUAn3hyEE2dMFStdDpEOCICdUH78msy =0IcE -----END PGP SIGNATURE-----