Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-10623

AJS.format doesn't handle negative numbers or extra whitespace in choice format

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 6.3.13.0
    • None
    • None

    Description

      NOTE: This bug report is for JIRA Software Server. Using JIRA Software Cloud? See the corresponding bug report.

      The Java ChoiceFormat documentation has an example pattern:

      "{0,choice,-1#is negative| 0#is zero or fraction | 1#is one |1.0<is 1+ |2#is two |2<is more than 2.}"
      

      As of AUI 5.3, AJS.format() supports ChoiceFormat, but that example will break with an error of "Cannot read property '1' of null"

      There are two different parts that break, due to the format of the regexes inside AJS.format():

      • Negative number
      • Whitespace surrounding the "|" characters

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gdavidson@atlassian.com Gilmore Davidson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: