On Mon, 6 Apr 2026 17:39:17 GMT, Justin Lu <[email protected]> wrote: > This PR includes two changes. First, `Locale.getDisplayScript(Locale)` > incorrectly copies the return description of its sibling method > `Locale.getDisplayScript()`. It is corrected to describe the actual contract. > > Second, the `getDisplayXXX` methods are updated to better distinguish the > `Locale` from which the methods are invoked on versus the `Locale` which is > used for localization of the output. An example of this issue is the > following, > > `Locale.getDisplayCountry()` states it returns "The name of the country > appropriate to the locale." > `Locale.String getDisplayCountry(Locale inLocale)` states it returns "The > name of the country appropriate to the given locale." > > In the no-arg method, "locale" is ambiguous and may refer to `this` or the > default display locale, while in the 1-arg method, "locale" is `inLocale`. It > would be more clear if the methods consistently referred to the same > "locale". i.e., either the one doing the localizing, or the one from which > the methods are invoked on.
This pull request has now been integrated. Changeset: 67f590d8 Author: Justin Lu <[email protected]> URL: https://git.openjdk.org/jdk/commit/67f590d8ba580d5cebbd041a30fef85c13d21e3b Stats: 32 lines in 1 file changed: 4 ins; 1 del; 27 mod 8381681: Clarify locale usage in Javadoc for the Locale display methods Reviewed-by: naoto ------------- PR: https://git.openjdk.org/jdk/pull/30590
