commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject [digester] Re: Why is Digester.configure() called multiple times during parse()?
Date Thu, 22 May 2003 17:03:41 GMT
hi neale

could you please remember to prefix with the name of the component when 
posting to this list. (most developers and committers use email filters.)

thanks for the accurate report. i haven't committed your suggestion (it 
would have introduced a slight change to the configure method symantics) 
but i have committed something very similar (configure calls initialize 
rather than the other way round) and i've improved the java docs.

- robert

On Thursday, May 22, 2003, at 04:57 PM, Neale Swinnerton wrote:

> Hi,
> I'm new to Digester and have been caught out by the following.
> I subclassed Digester, overriding the configure() method. After some
> puzzling results I discovered that my configure() method was called
> twice, meaning I had two of each of my rules, making my object graph 2x
> deeper than it should have been.
> On investigation of the source, I see that the Digester holds a
> configure flag that is checked in the configure() method. I needed to
> add a similar
>   if(configured) {
>    ...
>   }
> to my code.The existing javadoc incorrectly state that by default the
> configure() method does nothing.
> SO: Is there any reason why the subclass-er can't be protected from this
> mistake. I've attached a patch, with an initialise() method that does
> the check and calls the configure() method as appropriate, alternatively
> the javadoc comments could be updated to stop idiots like me making this
> mistake :-)
> regards
> Neale Swinnerton
>  ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message