> Please review this PR which modifies a suspicious check in the fallback of > `Locale.getDisplayName(Locale inLocale)`. > > As a fallback, a hard coded pattern is used. The previous code outputted the > qualifiers if the `displayNames` array had length greater than 2. Just a few > lines above, the array is initialized with a length of 3 and so the check is > pointless. > > It would be better, if replaced with a null check for the last element of the > `displayNames` array, as that element may be null if there are no qualifiers. > See L2317 , > > `qualifierNames.length != 0 ? formatList(qualifierNames, > listCompositionPattern) : null` > > For example, now a fallback (with no qualifiers) might look like: `German` > instead of `German (null)`. > But will remain the same (with qualifiers): `German (Germany)`.
Justin Lu has updated the pull request incrementally with one additional commit since the last revision: reflect review - chain appends ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21298/files - new: https://git.openjdk.org/jdk/pull/21298/files/e50424bb..2cfa9de7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21298&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21298&range=00-01 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21298.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21298/head:pull/21298 PR: https://git.openjdk.org/jdk/pull/21298