Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0, 2.1.x
-
None
Description
http://velocity.apache.org/engine/2.0/user-guide.html#set and http://velocity.apache.org/engine/devel/user-guide.html#set both have about a page of text explaining that #set will ignore any assignment with a null RHS and suggesting workarounds. However, even using the exact example shown, 2.0 does not ignore null RHSs, and the workarounds don't workatall, which as a complete newbie caused me a lot of head-scratching.
I can provide my (very simple) test harness and template if necessary, but the following caught my eye while trawling through the changelog:
Remove directive.set.null.allowed and instead always allow null to be #set to references. This also means removing all NullSetEventHandler code, since it was only in play when nulls were not allowed to be #set.
Which looks as if this was a deliberate change which forgot to update the user docs. I'm all in favour of the change, btw; the old documented behaviour was horrible. I'm just looking for some reassurance that I can rely on it.