<i18n dev> RFR: 8310890: Normalize identifier names

Pavel Rappo prappo at openjdk.org
Mon Jun 26 18:41:06 UTC 2023


On Mon, 26 Jun 2023 18:21:07 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Please review this cleanup PR to normalize names of identifiers which are Java variables/fields or tokens in text files. Those names either contain a pronoun that is very rarely used in code, or seem like they contain such a pronoun, which, in fact, they don't. Either way, the goal is to improve readability and clarity.
>> 
>> Also, this PR fixes a few related typos.
>
> src/java.base/share/classes/java/util/EnumMap.java line 690:
> 
>> 688:             Object otherValue = em.vals[i];
>> 689:             if (otherValue != ourValue &&
>> 690:                 (otherValue == null || !otherValue.equals(ourValue)))
> 
> Is this the same as java.util.Objects:  
>   `!Objects.equals(vals[i], em.vals[i]);`

You are right: we can fold this if-else construct into that utility method. That said, it in *this* PR, I'd prefer not to.

The reason is that I've been preparing a much bigger PR that uses Objects.equals as well as other utility methods and modern language features to improve some equals, hashCode, and compareTo implementations across java.base. I'm planning to publish that PR soon. In fact, this change to Java variable names was cherry-picked from that bigger PR, to separate trivial renames from code changes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14653#discussion_r1242608041


More information about the i18n-dev mailing list