Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 34123 invoked from network); 8 Jun 2004 08:31:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Jun 2004 08:31:23 -0000 Received: (qmail 57203 invoked by uid 500); 8 Jun 2004 08:31:32 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 56974 invoked by uid 500); 8 Jun 2004 08:31:31 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 56960 invoked by uid 99); 8 Jun 2004 08:31:31 -0000 Received: from [202.135.116.201] (HELO unxcoms01.ecnetwork.co.nz) (202.135.116.201) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 08 Jun 2004 01:31:31 -0700 Received: from serpent.ecnetwork.co.nz (serpent [202.135.190.10]) by unxcoms01.ecnetwork.co.nz (8.12.8/8.12.8) with ESMTP id i588V0XL014021 for ; Tue, 8 Jun 2004 20:31:00 +1200 Received: from pcjohns.ecnnz.ecnetwork.co.nz (unknown [202.135.190.30]) by serpent.ecnetwork.co.nz (Postfix) with ESMTP id CF7091035 for ; Tue, 8 Jun 2004 20:39:44 +1200 (NZST) Subject: [digester] clear method From: Simon Kitching To: Jakarta Commons Developers List In-Reply-To: <20040608082610.30537.qmail@minotaur.apache.org> References: <20040608082610.30537.qmail@minotaur.apache.org> Content-Type: text/plain Message-Id: <1086683460.5816.9.camel@pcsimon> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 08 Jun 2004 20:31:00 +1200 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I have just made this commit: On Tue, 2004-06-08 at 20:26, skitching@apache.org wrote: > skitching 2004/06/08 01:26:10 > > Modified: digester/src/java/org/apache/commons/digester Digester.java > Log: > Added javadoc to clear method about it being unsuitable for resetting > Digester for reuse. > > Revision Changes Path > 1.104 +6 -1 jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java > > Index: Digester.java > =================================================================== > RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v > retrieving revision 1.103 > retrieving revision 1.104 > diff -u -r1.103 -r1.104 > --- Digester.java 10 May 2004 07:15:20 -0000 1.103 > +++ Digester.java 8 Jun 2004 08:26:10 -0000 1.104 > @@ -2404,6 +2404,11 @@ > > /** > * Clear the current contents of the object stack. > + *

> + * Calling this method might allow another document of the same type > + * to be correctly parsed. However this method was not intended for this > + * purpose. In general, a separate Digester object should be created for > + * each document to be parsed. > */ > public void clear() { Does anyone remember what the original purpose of the clear method was? The comment "clear the current contents of the object stack" explains *what* it is doing, but not why this would be useful. This method is called automatically at the end of parse(). It was present in basically its current form in version 1.1 of this file, so there's no clues in the CVS log about why it does what it does, and why it is public. Resetting a Digester instance to a state where it can safely parse another input document is rather a tricky and fragile thing to do I believe; I had a go, and didn't feel at all happy about the code that was necessary so abandoned the attempt and just added the above comment. Thanks, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org