Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8055900

j.t.SimpleDateFormat spec needs to be clarified regarding month patterns

XMLWordPrintable

    • b127
    • Not verified

      1) The current spec for j.t.SimpleDateFormat says regarding the month patterns the following:
      "Month: If the number of pattern letters is 3 or more, the month is interpreted as text; otherwise, it is interpreted as a number.
          Letter M produces context-sensitive month names, such as the embedded form of names. If a DateFormatSymbols has been set explicitly with constructor SimpleDateFormat(String, DateFormatSymbols) or method setDateFormatSymbols(DateFormatSymbols), the month names given by the DateFormatSymbols are used.
          Letter L produces the standalone form of month names."

      "context-sensitive" doesn't mean "format" here, it means that the form of month (standalone or format or other) will selected dependent on the context.
      It would be great to clarify the spec to make it more clear and unambiguous.

      For details look at the JDK-8055689.

      2) There is a typo in the spec of j.t.DateFormatSymbols::getShortMonths:
      "If the language requires different forms for formatting and stand-alone usages, This method returns short month names in the formatting form."
      "This method" starts with the upper case symbol.

            nishjain Nishit Jain
            evotchen Elena Votchennikova (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: