Oops, more below.
> > Please put the pop int a finally block. The render() has not been
> > suficiently protected in the past to avoid exceptions. I see
> > that the ica is not reused so it really wouldn't matter, but who
> > knows, this might change...
> >
> > vp.render( ica, writer, null);
> > - ica.popCurrentTemplateName();
> > + }
> > + finally
> > + {
> > + ica.popCurrentTemplateName();
> > + }
> > catch (Exception e )
>
> That's a better catch than you think :) [ I meant to do that ... see
> Template :) ]
I saw Template.java in the commits *after* I write this recommendation,
but I *saw* it also does not have a finally block... So it should be
added there too (grep for popCurrentTemplateName to be sure we got 'em
all).
>
> Because the template name stack *isn't* really in the ica - it's in the
> baseclass InternalContextBase of VelocityContext... (via
> AbstractContext), so this would have accumulated... probably no harm,
> but not right either.
I still see no accumulation, since the VelocityContext/AbstractContext/
InternalContextBase is instantiated newly on every Template.init()
and Template.merge(). This instace (including template name stack) is
discarded after the call.
Am I missing some magic? Somehow I havn't figured out where
InternalContextBase is beeing instantiated (I never get the "Woo! no
ICB" message). The Template.merger() seems to me its getting a plain
VelocityContext (w/o a icb).
>
> Good one.
But yet need to analyze some more the overall mechanics of Vel.
:) Christoph