Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8153666 Optimize Formatter.formatMessage
  3. JDK-8159382

Release Note: java.util.logging.Formatter::formatMessage API specification has been clarified, and its implementation fixed.

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 9
    • 9
    • core-libs

      `java.util.logging.Formatter.formatMessage` API specification specified that `MessageFormat` would be called if the message string contained "{0". In practice `MessageFormat` was called if the message string contained either "{0", "{1", "{2" or "{3".

      In Java SE 9, the specification and implementation of this method have been changed to call `MessageFormat` if the message string contains "{<i>&lt;digit></i>", where <i>&lt;digit></i> is in [0..9].

      In practice, this should be transparent for calling applications.

      The only case where an application might see a behaviour change is if the application passes a format string that does not contain any formatter of the form "{0", "{1", "{2" or "{3", but contains "{<i>&lt;digit></i>" with <i>&lt;digit></i> within [4..9], along with an array of parameters that contains at least <i>&lt;digit></i>+1 elements, and depends on `MessageFormat` not to be called. In that case the method will return a formatted message instead of the format string.

            dfuchs Daniel Fuchs
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: