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

8309692: Fix -Wconversion warnings in javaClasses #14397

Closed
wants to merge 1 commit into from

Conversation

coleenp
Copy link
Contributor

@coleenp coleenp commented Jun 9, 2023

Please review this trivial patch to remove implicit integer conversions in javaClasses.inline.hpp/cpp files.
Tested tier1-4.


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

  • JDK-8309692: Fix -Wconversion warnings in javaClasses (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14397

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 9, 2023

👋 Welcome back coleenp! 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 openjdk bot added the rfr Pull request is ready for review label Jun 9, 2023
@openjdk
Copy link

openjdk bot commented Jun 9, 2023

@coleenp The following label will be automatically applied to this pull request:

  • hotspot-runtime

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

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jun 9, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 9, 2023

Webrevs

@openjdk
Copy link

openjdk bot commented Jun 9, 2023

@coleenp 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:

8309692: Fix -Wconversion warnings in javaClasses

Reviewed-by: fparain, matsaave

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 90 new commits pushed to the master branch:

  • cee5724: 8309727: Assert privileges while reading the jdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK system property
  • 7d6f97d: 8309673: Refactor ref_at methods in SA ConstantPool
  • 7a970b2: 8309310: Update --release 21 symbol information for JDK 21 build 26
  • 84184f9: 8232839: JDI AfterThreadDeathTest.java failed due to "FAILED: Did not get expected IllegalThreadStateException on a StepRequest.enable()"
  • 679a6d8: 8309303: jdk/internal/misc/VM/RuntimeArguments test ignores jdk/internal/vm/options
  • 6cd370e: 8305645: System Tray icons get corrupted when Windows primary monitor changes
  • a48bcf3: 8308336: Test java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java failed: java.net.BindException: Address already in use
  • c052756: 8282797: CompileCommand parsing errors should exit VM
  • dc842e8: 8309665: Simplify Arrays.copyOf/-Range methods
  • 3070856: 8309702: Exclude java/lang/ScopedValue/StressStackOverflow.java from JTREG_TEST_THREAD_FACTORY=Virtual runs
  • ... and 80 more: https://git.openjdk.org/jdk/compare/98b53c06cfffe7b2e21968546b4aa1523f31132e...master

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 9, 2023
@coleenp
Copy link
Contributor Author

coleenp commented Jun 9, 2023

Thanks Fred. I think you agree it's trivial?

Copy link
Contributor

@matias9927 matias9927 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! Seems trivial as well

@fparain
Copy link
Contributor

fparain commented Jun 9, 2023

Yes, it is trivial.

@coleenp
Copy link
Contributor Author

coleenp commented Jun 9, 2023

Thanks Fred and Matias!
/integrate

@openjdk
Copy link

openjdk bot commented Jun 9, 2023

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

  • 7d82479: 8309142: Refactor test/langtools/tools/javac/versions/Versions.java
  • f5ec93e: 8309745: Problem list open client tests failing on Ubuntu_23.04
  • cee5724: 8309727: Assert privileges while reading the jdk.incubator.vector.VECTOR_ACCESS_OOB_CHECK system property
  • 7d6f97d: 8309673: Refactor ref_at methods in SA ConstantPool
  • 7a970b2: 8309310: Update --release 21 symbol information for JDK 21 build 26
  • 84184f9: 8232839: JDI AfterThreadDeathTest.java failed due to "FAILED: Did not get expected IllegalThreadStateException on a StepRequest.enable()"
  • 679a6d8: 8309303: jdk/internal/misc/VM/RuntimeArguments test ignores jdk/internal/vm/options
  • 6cd370e: 8305645: System Tray icons get corrupted when Windows primary monitor changes
  • a48bcf3: 8308336: Test java/net/HttpURLConnection/HttpURLConnectionExpectContinueTest.java failed: java.net.BindException: Address already in use
  • c052756: 8282797: CompileCommand parsing errors should exit VM
  • ... and 82 more: https://git.openjdk.org/jdk/compare/98b53c06cfffe7b2e21968546b4aa1523f31132e...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 9, 2023

@coleenp Pushed as commit beec734.

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

@@ -1274,7 +1274,7 @@ const int ObjectAlignmentInBytes = 8;
"(0.0 means off)") \
range(0.0, (double)max_intx) \
\
product(intx, MaxJavaStackTraceDepth, 1024, \
Copy link
Member

Choose a reason for hiding this comment

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

Seems unrelated to the described issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This accounted for 2 warnings in javaClasses.cpp.

@coleenp coleenp deleted the javaclasses branch June 12, 2023 12:19
assert((jushort)bci == bci, "bci should be short");
return build_int_from_shorts(version, bci);
assert((u2)bci == bci, "bci should be short");
return build_int_from_shorts((u2)version, (u2)bci);

Choose a reason for hiding this comment

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

How about instead, something like

return build_int_from_shorts((u2)version, checked_cast<u2>(bci));

I guess that loses the explicit message, but seems otherwise clearer to me.

return build_int_from_shorts(cpref, mid);
assert((u2)mid == mid, "mid should be short");
assert((u2)cpref == cpref, "cpref should be short");
return build_int_from_shorts((u2)cpref, (u2)mid);

Choose a reason for hiding this comment

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

Similarly here, could use

return build_int_from_shorts(checked_cast<u2>(cpref), checked_cast<u2>(mid));

@kimbarrett
Copy link

Oh well, I didn't notice this had already been integrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
5 participants