Return-Path: Delivered-To: apmail-directory-api-archive@minotaur.apache.org Received: (qmail 79593 invoked from network); 27 Apr 2010 10:01:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Apr 2010 10:01:28 -0000 Received: (qmail 37700 invoked by uid 500); 27 Apr 2010 10:01:28 -0000 Delivered-To: apmail-directory-api-archive@directory.apache.org Received: (qmail 37660 invoked by uid 500); 27 Apr 2010 10:01:27 -0000 Mailing-List: contact api-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: api@directory.apache.org Delivered-To: mailing list api@directory.apache.org Received: (qmail 37651 invoked by uid 99); 27 Apr 2010 10:01:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Apr 2010 10:01:27 +0000 X-ASF-Spam-Status: No, hits=-0.6 required=10.0 tests=AWL,FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of elecharny@gmail.com designates 74.125.82.178 as permitted sender) Received: from [74.125.82.178] (HELO mail-wy0-f178.google.com) (74.125.82.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Apr 2010 10:01:20 +0000 Received: by wyf22 with SMTP id 22so317142wyf.37 for ; Tue, 27 Apr 2010 03:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=Mo80q3cauBlNzK7po15Mz0fo/G2jkfFMzuFAYMapEL0=; b=OT9qoylSGTEdEk9x24ZnovFB3tV1sbtcV+im2n07FhKpDzXpk0E80UIzP4ys6feEoI FlJm8pfEqGwRn6ooowXSr+myb06NNuu+kztbGQQW85/QKUCjmo2zBeB6R/4IhwVCPWwG j6fHI5aksi0fsydrRLN9/uz5T49G5odyWW9qw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=iyQf500J4mD3Yl14mAgg5OrciOPfSUw4Ux/AjgZQ5NGw1Cxtd4LLETCYAyj/muOwwP b7mVrBTi89vYbtJ/qzXefgwOg9nQCvr7FoqGUqIMpsVVJFhDm8hLteq+ayUdsIz55L7Y FAZsS7pUx6oYiM2e8dno044E4VeKwCZAUrSg8= Received: by 10.216.169.194 with SMTP id n44mr5916415wel.10.1272362454069; Tue, 27 Apr 2010 03:00:54 -0700 (PDT) Received: from emmanuel-lecharnys-MacBook-Pro.local (lon92-10-78-226-4-211.fbx.proxad.net [78.226.4.211]) by mx.google.com with ESMTPS id v59sm981060wec.15.2010.04.27.03.00.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Apr 2010 03:00:53 -0700 (PDT) Message-ID: <4BD6B5D4.9010203@gmail.com> Date: Tue, 27 Apr 2010 12:00:52 +0200 From: Emmanuel Lecharny Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: api@directory.apache.org Subject: Entry and Attribute comparisons Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi, just wondering how deep we should go when implementing the equals() and hashcode() methods : - for an entry, is it enough to check that the DN is equal ? Otherwise, we will have to sort all the attributes (based on their OID, I guess), then for each Attribute, sort all of their value (using the normalized value of course, which means the Attribute is schema aware)... - for an Attribute, as stated above, we will have somehow to sort the normalized values, using the specific syntax for the Attribute, otherwise we might not be able to compare two Attributes. I would rather go for a simpler version of hashcode() and equals() where we only compare DN for entries and the attribute ID for Attribute. The rational is that we usually never compare entries (or we use a dedicated method for that : compare()), and we only need to check if an Attribute is stored into an Entry (speaking about the hashcode method). For the Attribute equals method, this is slightly different. I'm not sure we should compare all the values, but right now, I see no other way to do it... Thoughts ? -- Regards, Cordialement, Emmanuel L�charny www.nextury.com