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

java.text.MessageFormat does not support java.time.* types

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Fix
    • P4
    • None
    • 8
    • core-libs

    Description

      FULL PRODUCT VERSION :
      java version " 1.8.0-ea "
      Java(TM) SE Runtime Environment (build 1.8.0-ea-b93)
      Java HotSpot(TM) 64-Bit Server VM (build 25.0-b34, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 64-bit

      A DESCRIPTION OF THE PROBLEM :
      Currently, MessageFormat /only/ supports SimpleDateFormat and instances of java.util.Date or java.util.Calendar for date/time values. Because of this, it's impossible to use Java 8 date/time types with any of the i18n and localization tools.

      MessageFormat really needs support for types in java.time. I'm not even sure how it should work. I'm not sure how MessageFormat can know whether a SimpleDateFormat string or a DateTimeFormatter string is being supplied. Possibly, validation of the format string must be delayed until either a Date/Calendar or a java.time type is supplied for formatting.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      Attachments

        Activity

          People

            nishjain Nishit Jain
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: