Velocity
  1. Velocity
  2. VELOCITY-549

Allow directives to detect whether literals are constant

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None

      Description

      Add isConstant() method to ASTStringLiteral, which exposes interpolate, so that calling code can detect constant string literals.

        Activity

        Adam Heath created issue -
        Adam Heath made changes -
        Field Original Value New Value
        Attachment feature_ASTStringLiteral-expose-interpolate.patch [ 12357215 ]
        Adam Heath made changes -
        Affects Version/s 1.5 [ 12310253 ]
        Component/s Engine [ 12311337 ]
        Hide
        Will Glass-Husain added a comment -

        A simple patch, don't mind applying it, but I'm not sure I understand why this is needed. Can you give a use case when this would be helpful?

        Show
        Will Glass-Husain added a comment - A simple patch, don't mind applying it, but I'm not sure I understand why this is needed. Can you give a use case when this would be helpful?
        Hide
        Adam Heath added a comment -

        If a directive implementation sees it's parameters are constant, it could evaluate them at initialization time, and substitute a more efficient version for evaluation at runtime.

        Show
        Adam Heath added a comment - If a directive implementation sees it's parameters are constant, it could evaluate them at initialization time, and substitute a more efficient version for evaluation at runtime.
        Hide
        Will Glass-Husain added a comment -

        patch applied.

        Show
        Will Glass-Husain added a comment - patch applied.
        Will Glass-Husain made changes -
        Fix Version/s 1.6 [ 12310290 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Mark Thomas made changes -
        Workflow jira [ 12403840 ] Default workflow, editable Closed status [ 12551942 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12551942 ] jira [ 12552708 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        21d 23h 50m 1 Will Glass-Husain 05/Jun/07 05:18

          People

          • Assignee:
            Unassigned
            Reporter:
            Adam Heath
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development