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

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Unresolved
    • Major
    • None
    • 11.10
    • Velocity
    • None
    • Unit
    • Unknown

    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

            Unassigned Unassigned
            vmassol Vincent Massol
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: