Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8310890: Normalize identifier names #14653

Closed
wants to merge 2 commits into from

Conversation

pavelrappo
Copy link
Member

@pavelrappo pavelrappo commented Jun 26, 2023

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14653/head:pull/14653
$ git checkout pull/14653

Update a local copy of the PR:
$ git checkout pull/14653
$ git pull https://git.openjdk.org/jdk.git pull/14653/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14653

View PR using the GUI difftool:
$ git pr show -t 14653

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14653.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 26, 2023

👋 Welcome back prappo! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 26, 2023

@pavelrappo The following labels will be automatically applied to this pull request:

  • build
  • core-libs
  • i18n

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org i18n i18n-dev@openjdk.org labels Jun 26, 2023
@pavelrappo pavelrappo marked this pull request as ready for review June 26, 2023 17:57
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 26, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 26, 2023

Webrevs

Copy link
Member

@naotoj naotoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me

@openjdk
Copy link

openjdk bot commented Jun 26, 2023

@pavelrappo This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8310890: Normalize identifier names

Reviewed-by: naoto, rriggs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 5 new commits pushed to the master branch:

  • 815ac6e: 8310907: Add missing file
  • 289f218: 8310861: Improve location reporting for javac serial lint warnings
  • d32eb01: 8310682: No package-info (and @SInCE) for package jdk.nio.mapmode
  • e624484: 8308540: On Kerberos TGT referral, if krb5.conf is missing realm, bad exception message
  • 5ff42d1: 8303549: [AIX] TestNativeStack.java is failing with exit value 1

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 26, 2023
Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, with or without the suggestion.

Comment on lines +688 to +690
Object otherValue = em.vals[i];
if (otherValue != ourValue &&
(otherValue == null || !otherValue.equals(ourValue)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same as java.util.Objects:
!Objects.equals(vals[i], em.vals[i]);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -146,7 +146,7 @@ charset ISO-8859-1 ISO_8859_1
charset ISO-8859-2 ISO_8859_2
package sun.nio.cs
type sbcs
hisname ISO8859_2
histname ISO8859_2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this column be re-aligned with the longer name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it before publishing the PR. I decided not to re-align anything because (i) the change would be bigger and (ii) the fact that there was already a property that is similarly misaligned; search for:

internal true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are concerned with functionality rather than looks, then I can tell you this:

  1. The build succeeds and tier1 tests pass.

  2. The code that parses that file expect one or more whitespace characters as a separator:

     String[] tokens = line.split("\\s+");
    

@pavelrappo
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Jun 27, 2023

Going to push as commit f6133ed.
Since your change was applied there have been 22 commits pushed to the master branch:

  • 58bb655: 8222329: Readable read(CharBuffer) does not specify that 0 is returned when there is no remaining space in buffer
  • 05e9c41: 8310731: Configure a javax.net.ssl.SNIMatcher for the HTTP/1.1 test servers in java/net/httpclient tests
  • 1587836: 8310425: [JVMCI] compiler/runtime/TestConstantDynamic: lookupConstant returned an object of incorrect type: null
  • 73d7aa1: 8301489: C1: ShortLoopOptimizer might lift instructions before their inputs
  • 990e3a7: 8308899: Introduce Classfile context and improve Classfile options
  • 79c056e: 8006421: GraphicsConfiguration of a frame is changed when the frame is moved to another screen
  • 45b581b: 8309583: AArch64: Optimize firstTrue() when amount of elements < 8
  • 87e6fab: 8310873: Re-enable locked_create_entry symbol check in runtime/NMT/CheckForProperDetailStackTrace.java for RISC-V
  • 39fa4e6: 8310489: New test runtime/ClassInitErrors/TestStackOverflowDuringInit.java failed
  • 46add3f: 8310909: java.io.InvalidObjectException has redundant @since tag
  • ... and 12 more: https://git.openjdk.org/jdk/compare/24abd1054e236118877860dd8b89d52d499c261b...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 27, 2023
@openjdk openjdk bot closed this Jun 27, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 27, 2023
@openjdk
Copy link

openjdk bot commented Jun 27, 2023

@pavelrappo Pushed as commit f6133ed.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org i18n i18n-dev@openjdk.org integrated Pull request has been integrated
4 participants