Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-902

User guide for #set does not match behaviour

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1.x
    • Fix Version/s: 2.0
    • Component/s: Documentation
    • Labels:
      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.

        Attachments

          Activity

            People

            • Assignee:
              cbrisson Claude Brisson
              Reporter:
              mrec Mike Capp
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: