Here a very simple proposal.
Allow a bang on a RHS reference in ASTSetDirective.render to supress
log messages when the it evalutes to null.
>
> No. The bang says to velocity, "If this isn't a reference, don't render
> the literal". So if a template was
>
> -------
> $blargh
> $!blargh
> --------
>
> and blargh was not in the context, you would get
>
> ------
> $blargh
> ------
>
> becuase of the ! on the second blargh.
Sure, this is because ASTReference checks for a "$!" during init
and sets QUIET_REFERENCE to supress the log.
For:
> > The #set (and its ASTSetDirective.render) requires allowing a bang to
> > avoid log messages; then use:
> > #macro(ignore $foo)#local($dummy)#set($dummy = $!foo)#end#end
> >
>
> But that's not formally what bang does. The log is a separate issue.
> An invalid render or #set is logged w/ or w/o the !. You can control
> the logging from properties.
Thats why I'm proposing to do the same for ASTSetDirective.render
to handle a RHS starting with "$!" to suppress log messages.
:) Christoph