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

Calling "empty" javabean method on automatically upgraded array

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 2.0
    • Component/s: Engine
    • Labels:
      None

      Description

      Velocity has a feature that allows calling List methods on arrays.
      I tried doing that on a String array.

      #if ($data.viewOnlineLinkLocales.empty)
      Hello
      #end
      

      "data" has a method:

          public List<String> getViewOnlineLinkLocales() {
              String localeStr = getProperty(LOCALES);
              if (localeStr == null) {
                  return new String[0];
              }
              return StringUtils..split(",");
          }
      

      When I try this for localeStr = null, the "empty" is returning false. On the other hand when I replace it with "isEmpty()" it correctly returns true.

        Activity

        Hide
        claude Claude Brisson added a comment -

        not sure it's a major issue, since you have isEmpty(), but well, commited. Commit 1753755.

        Show
        claude Claude Brisson added a comment - not sure it's a major issue, since you have isEmpty(), but well, commited. Commit 1753755.

          People

          • Assignee:
            claude Claude Brisson
            Reporter:
            krzyk Krzysztof Krason
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development