Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 72858 invoked from network); 23 Jun 2004 23:44:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Jun 2004 23:44:56 -0000 Received: (qmail 15985 invoked by uid 500); 23 Jun 2004 23:45:20 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 15865 invoked by uid 500); 23 Jun 2004 23:45:19 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 15818 invoked by uid 99); 23 Jun 2004 23:45:18 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [155.91.6.30] (HELO usryim07.merck.com) (155.91.6.30) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 23 Jun 2004 16:45:17 -0700 Received: from 155.91.2.6 by usryim07.merck.com with ESMTP (SMTP Relay); Wed, 23 Jun 2004 19:44:29 -0400 X-Server-Uuid: 807C5EE5-520D-472F-9CE4-130BFF27C010 Received: from 54.3.102.166 by usrytw31.merck.com with ESMTP (Tumbleweed MMS SMTP Relay (MMS v5.6.1)); Wed, 23 Jun 2004 19:44:16 -0400 X-Server-Uuid: 8B3DBB5A-E137-4F83-92C3-7F1E10978F75 Received: by usrygw30.merck.com with Internet Mail Service (5.5.2657.72) id ; Wed, 23 Jun 2004 19:44:16 -0400 Message-ID: <2F07B8A0EC85D511B34700508BB22A8206876DB4@uswsmx24.merck.com> From: "Roth, Scott" To: dev@cocoon.apache.org Subject: Bug in XMLFileModule Date: Wed, 23 Jun 2004 19:44:10 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) X-WSS-ID: 6CC4CA5A1QO2188559-01-01 X-WSS-ID: 6CC4CA571EW8780464-01-01 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I am pretty sure that I have found a small bug in the XMLFileModule. I just wanted to run it by the dev list before I submitted a patch to Bugzilla. According to the contract exposed in the excalibur SourceValidity interface: To avoid testing what the actual implementation of the validity object supports, the invocation order is to first call isValid() and only if this result is 0 (i.e. "don't know"), then to call isValid(SourceValidity). The XMLFileModule doesn't first call isValid(). See line 170: "if (srcVal != null && this.srcVal.isValid(valid) != 1) {" It goes right to testing isValid(SourceValidity). Anyway, because the SourceValidity implementations are expecting the 2 methods to both be called, it is possible to get unexpected behavior when only the second call is made. In my case (using ExpiresValidity), the file was being reloaded on every request because this SourceValidity implementation always returns INVALID for isValid(SourceValidity). (It never expects that call to be made because isValid() never returns UNKNOWN.) Please, let me know if I am missing something or if I have indeed uncovered a small bug. I will be happy to submit a patch if it is warranted. Alternatively, a committer may just want to make the change themselves. The code change is very small - replacing line 170 with a few new lines of code that calls both isValid methods. Thanks, Scott Roth ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. ------------------------------------------------------------------------------