<i18n dev> RFR: 8301492: Modernize equals() method of ResourceBundle.CacheKey and Bundles.CacheKey [v3]

Pavel Rappo prappo at openjdk.org
Fri Jun 23 22:05:14 UTC 2023


On Wed, 1 Feb 2023 10:36:12 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:

>> `ResourceBundle.CacheKey.equals()` and `Bundles.CacheKey.equals()` are quire outdated. This simple clean-up modernizes them.
>
> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Restore logic

src/java.base/share/classes/sun/util/resources/Bundles.java line 510:

> 508:                     return false;
> 509:                 }
> 510:                 return Objects.equals(locale, otherEntry.locale)

While the proposal is not wrong, you might want to consider reverting the change to those two lines: 511 and 512. The reason being is that neither `locale` nor `name` can be null, if I understand this class correctly. 

NPE was seemingly caught to cover for `other` being null.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/12328#discussion_r1240442051


More information about the i18n-dev mailing list