You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Simon Kitching <sk...@apache.org> on 2006/07/02 23:52:53 UTC

Re: Digester push(null)

Hi Joachim,

On Wed, 2006-06-28 at 14:37 +0200, Joachim Fuchs wrote:
> Hi,
> 
> I found this code in Tomcat's ContextConfig.java:
> 
> <code>
> webDigester.clear();
> webDigester.push(context);
> webDigester.parse(is);
> webDigester.push(null);
> </code>
> 
> My question is what happens with the digester when pushing a null reference?
> I expect a null pointer expetion to be thrown, so what is this good for?

There won't necessarily be a null pointer exception. That would only
happen if some rule is executed that tries to invoke a method on that
object on the stack.

However it does look rather odd. I can't think of a good reason for
pushing a null onto the stack, particularly *after* parsing is complete.

Can you provide the full package name for this class (and tomcat
version) so I can have a look at the tomcat code for myself?

Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org