JDK-6955047 : (tz) javadoc for TimeZone.getDisplayName(boolean daylight, int style, Locale locale) is not clear
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2010-05-24
  • Updated: 2017-05-16
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b134Fixed
Related Reports
Relates :  
Relates :  
Description
----------------------------------------------------
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.

Comments
EVALUATION This one was partially fixed as 6638110. Still need to clarify how the daylight saving time name is related to daylight saving time observation.
07-02-2011