Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-1930

Make it simpler and nicer for Velocity scripts to handle Optional return values

    Details

    • Type: New Feature
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 11.10
    • Fix Version/s: None
    • Component/s: Velocity
    • Labels:
      None
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      Context: see https://forum.xwiki.org/t/start-using-optional-for-return-values-when-they-can-be-null/6647

      Example:

      Before:

      #set ($value = $var.someMethodReturningOptional.get())
      

      After:

      #set ($value = $var.someMethodReturningOptional)
      

      Will return null if the optional is null.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vmassol Vincent Massol
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: