Uploaded image for project: 'Velocity Tools'
  1. Velocity Tools
  2. VELTOOLS-69

ValueParserSub generic getter never worked

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.3
    • VelocityView
    • None

    Description

      (I attach this issue to the VelocityView component but we may need a Generic component in Jira)

      When $query is the ValueParser object for the query string http://...?foo=5,
      then $query.foo.int is an invalid reference.

      Why? Because there is a collision of variable names in ValueParserSub.get(Object key).

      I profit of this opportunity to state that I really don't like the ValueParserSub class, because it breaks the "#if($query.foo)" syntax. Hence, it is not backward compatible. Or at least, it could return null for an unexistant key.

      Is it really usefull to keep it now that Velocity handles conversions much better? Since obviously nobody used the $query.foo.int feature, it is still time to remove it... Also, since the need to convert between types can emerge elsewhere, it would be much cleaner to have a standalone converter object. Yes, we loose the syntax $query.foo.int, but is it that nice a syntax?

      Attachments

        1. valueparser.patch
          3 kB
          Claude Brisson

        Activity

          People

            Unassigned Unassigned
            cbrisson Claude Brisson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: