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

(tz) javadoc for TimeZone.getDisplayName(boolean daylight, int style, Locale locale) is not clear

XMLWordPrintable

    • b134
    • x86
    • linux
    • Not verified

      ----------------------------------------------------
      public String getDisplayName(boolean daylight,
                                   int style,
                                   Locale locale)

          Returns a name of this time zone suitable for presentation to the user in the specified locale. If the display name is not available for the locale, then this method returns a string in the normalized custom ID format.

          Parameters:
              daylight - if true, return the daylight savings name.
              style - either LONG or SHORT
              locale - the locale in which to supply the display name.
          Returns:
              the human-readable name of this time zone in the given locale.
          Throws:
              IllegalArgumentException - style is invalid.
      ----------------------------------------------------

      From this description it is not clear what will be returned if:

      * true is passed as first argument to this method
      * useDaylightTime() returns true for this TimeZone instance

      As far as I see from 6300580 this method shall not take into account value of useDaylightTime() and return DST display name.

      However this decision should be reflected in javadocs.

            okutsu Masayoshi Okutsu
            sreznick Sergey Reznick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: