Skip to content

Conversation

@TheShermanTanker
Copy link
Contributor

@TheShermanTanker TheShermanTanker commented Oct 23, 2024

After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did


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-8342868: Errors related to unused code on Windows after 8339120 in core libs (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21654

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 23, 2024

👋 Welcome back jwaters! 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 Oct 23, 2024

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

8342868: Errors related to unused code on Windows after 8339120 in core libs

Reviewed-by: naoto, jlu

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 3566 new commits pushed to 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 changed the title 8342868 8342868: Errors related to unused code on Windows after 8339120 in core libs Oct 23, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 23, 2024
@openjdk
Copy link

openjdk bot commented Oct 23, 2024

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

  • core-libs
  • i18n
  • net

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 core-libs core-libs-dev@openjdk.org net net-dev@openjdk.org i18n i18n-dev@openjdk.org labels Oct 23, 2024
@mlbridge
Copy link

mlbridge bot commented Oct 23, 2024

Webrevs

@TheShermanTanker
Copy link
Contributor Author

Bumping, please advise on whether the fixes are correct or not

int got = 0;
// int got = 0;

/*
Copy link
Member

Choose a reason for hiding this comment

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

Don't understand this one at all - what did gcc actually complain about here? This code all seems used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The warning received is that got is set but not used - I had a look at getLocaleInfoWrapper and it seems like it has no side effects, its only purpose is to return a value, which is the variable got in this case. I'm pretty certain got not being used is a bug, and that it is needed somewhere, but someone forgot to hook it up to whatever needs it

Copy link
Member

Choose a reason for hiding this comment

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

It does seem a bug, where the return value is not handled correctly. Can you please file a separate bug?

Copy link
Member

@justin-curtis-lu justin-curtis-lu Oct 30, 2024

Choose a reason for hiding this comment

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

I had a look at getLocaleInfoWrapper and it seems like it has no side effects, its only purpose is to return a value

While got is not needed here, I am not convinced that getLocaleInfoWrapper is not used, so we shouldn't comment out all of the code, but rather just remove got. getLocaleInfoWrapper updates the outbound variable pattern (see https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex), which is used to get the right string pattern from fixes.

Usually, based on got, appropriate action is taken, but that's not needed in this case, because pattern is either updated or remains its fallback 0 value. So I presume that is why got is ignored in this case.

We could just add that got removal to this patch, what do you think @naotoj?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, Justin. That is correct. Only pattern is relevant here. No need to check got so it can safely be removed.

Copy link
Member

Choose a reason for hiding this comment

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

Not my area but this fix looks reasonable.

TziValue tempTzi;
WCHAR *stdNamePtr = tzi.StandardName;
int onlyMapID;
// int onlyMapID;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this became unused with JDK-8209167, so deleting it seems fine to me.

static jfieldID status_seqCompleteID;

static HINSTANCE lib = NULL;
// static HINSTANCE lib = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this became unused with JDK-7030256, so removal seems fine.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 31, 2024
Copy link
Member

@justin-curtis-lu justin-curtis-lu left a comment

Choose a reason for hiding this comment

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

Locale and TimeZone files LGTM. I also think its safe to just delete the offending onlyMapID and got (as opposed to commenting), since there is no bug and they are simply unusued.

@TheShermanTanker
Copy link
Contributor Author

Thanks for the reviews! I would delete them entirely, but I don't want to invalidate the existing reviews and force you guys to re-approve again :(

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 2, 2024

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Keep it open Skara, I'm waiting for the other Pull Requests to be approved so I can do them all at once

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 30, 2024

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Stop asking, I still need awt and accessibility to be approved :(

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 27, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Keep open please

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 25, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Keep open please

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 25, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Keep it open please. Life is not being kind to me at the moment, I apologize for the delays

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 22, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Stay open

@bridgekeeper
Copy link

bridgekeeper bot commented May 21, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

/touch

@openjdk
Copy link

openjdk bot commented May 21, 2025

@TheShermanTanker The pull request is being re-evaluated and the inactivity timeout has been reset.

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 18, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

/touch

@openjdk
Copy link

openjdk bot commented Jun 19, 2025

@TheShermanTanker The pull request is being re-evaluated and the inactivity timeout has been reset.

@jaikiran
Copy link
Member

Hello @TheShermanTanker, I see that this PR is marked as ready for integration since several months. But there's also your comment which says:

I still need awt and accessibility to be approved

I don't see any client area changes in this PR. Is there anything that's needed to be done to move forward with integrating this? I don't mean that you should integrate it "now" - I see that this branch hasn't been merged against master branch for several months, so that would be the first thing to do.

@TheShermanTanker
Copy link
Contributor Author

Sorry for waiting so long. It's become clear that I won't be able to get awt and accessibility up to speed for a long time, so I will go ahead with this one first

@TheShermanTanker
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jul 8, 2025

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jul 8, 2025

@TheShermanTanker Pushed as commit bbc5c98.

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

@TheShermanTanker TheShermanTanker deleted the core branch July 8, 2025 01:30
@dholmes-ora
Copy link
Member

@TheShermanTanker the commented out code really should have been deleted, not just left commented out. Please file anpther JBS issue to have this cleaned up so it is not forgotten. Thanks.

@jaikiran
Copy link
Member

jaikiran commented Jul 8, 2025

Since your change was applied there have been 3762 commits pushed to the master branch

It's usually risky to be integrating a PR which is so far behind the master branch, without first merging the latest changes and running the tier tests. In this case it hasn't caused any failures in the tier testing so far.

@TheShermanTanker
Copy link
Contributor Author

Since your change was applied there have been 3762 commits pushed to the master branch

It's usually risky to be integrating a PR which is so far behind the master branch, without first merging the latest changes and running the tier tests. In this case it hasn't caused any failures in the tier testing so far.

I'll keep that in mind next time I'm submitting another Pull Request. Fortunately in this case the code touched was dead code and in an area that isn't touched often, so shouldn't cause major issues

@TheShermanTanker
Copy link
Contributor Author

@dholmes-ora Sorry about that. Here's the issue as was requested: https://bugs.openjdk.org/browse/JDK-8361593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org i18n i18n-dev@openjdk.org integrated Pull request has been integrated net net-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

5 participants