Return-Path: Delivered-To: apmail-avalon-dev-archive@www.apache.org Received: (qmail 90928 invoked from network); 29 Jul 2004 06:59:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Jul 2004 06:59:00 -0000 Received: (qmail 66072 invoked by uid 500); 29 Jul 2004 06:58:22 -0000 Delivered-To: apmail-avalon-dev-archive@avalon.apache.org Received: (qmail 65958 invoked by uid 500); 29 Jul 2004 06:58:19 -0000 Mailing-List: contact dev-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list dev@avalon.apache.org Received: (qmail 65372 invoked by uid 99); 29 Jul 2004 06:58:13 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [202.187.40.2] (HELO f2.hedhman.org) (202.187.40.2) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 28 Jul 2004 23:58:10 -0700 Received: from f2.hedhman.org (f2.hedhman.org [127.0.0.1]) by f2.hedhman.org (8.12.8/8.12.8) with ESMTP id i6T6w5Cj020413; Thu, 29 Jul 2004 14:58:06 +0800 From: Niclas Hedhman Organization: Private To: "Avalon Developers List" Subject: Semantic bug in Framework? Date: Thu, 29 Jul 2004 14:58:05 +0800 User-Agent: KMail/1.5 Cc: Excalibur Developers List MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200407291458.05310.niclas@hedhman.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Gang, Since I am digging in Framework, I also stumbled upon another problem. Either it is a semantic bug in the intentions, or a bug in the ConfigurationUtils.equals() method. The problem is highlighted in an added testcase, which now fails in Framework implementation. It goes something like this; The two configurations Configuration a = 1 2 and Configuration b = 2 1 then a.equals( b ) --> TRUE It is not specified in the Javadocs of Configuration, but it is said in Javadocs of DefaultConfiguration that getChild( String element ), will return the FIRST child. SO; String v1 = a.getChild( "b" ).getValue(); String v2 = b.getChild( "b" ).getValue(); return v1.equals( v2 ); evaluates to FALSE !!!! In which case the two Configurations can NOT be considered equal. I can imagine this is quite a headache, and the only way out as I see it, is that Configurations must be same in order of its children as well, to be considered equal. Furthermore, the current equals() implementation is very slow for large configurations, as it does at worst O(n!) iterations through the tree. What are we going to do about this? Cheers Niclas -- +------//-------------------+ / http://www.bali.ac / / http://niclas.hedhman.org / +------//-------------------+ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org For additional commands, e-mail: dev-help@avalon.apache.org