You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Joachim Fuchs <jo...@dai-labor.de> on 2006/06/28 14:37:12 UTC
Digester push(null)
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?
I am not subscribed to the list, please CC me.
Joachim
Dipl. Inform. Joachim Fuchs
DAI-Labor - Technische Universität Berlin Sekretariat GOR 1-1, Franklinstraße 28/29, 10587 Berlin
Fon: +49 30 314 23383
joachim.fuchs@dai-labor.de
http://www.dai-labor.de
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Digester push(null)
Posted by Simon Kitching <sk...@apache.org>.
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