Skip to content

8361493: RepaintManager.invalidComponents uses different equality when searching element#30184

Open
Renjithkannath wants to merge 1 commit intoopenjdk:masterfrom
Renjithkannath:8361493-v2
Open

8361493: RepaintManager.invalidComponents uses different equality when searching element#30184
Renjithkannath wants to merge 1 commit intoopenjdk:masterfrom
Renjithkannath:8361493-v2

Conversation

@Renjithkannath
Copy link
Contributor

@Renjithkannath Renjithkannath commented Mar 11, 2026

Hi Reviewers,

I have updated the method with for loop and == so the code will mach with addInvalidComponent

Please review and let me know your suggestions


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-8361493: RepaintManager.invalidComponents uses different equality when searching element (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30184

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 11, 2026

👋 Welcome back rkannathpari! 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 Mar 11, 2026

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

8361493: RepaintManager.invalidComponents uses different equality when searching element

Reviewed-by: aivanov

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 39 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aivanov-jdk) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk
Copy link

openjdk bot commented Mar 11, 2026

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

  • client

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 rfr Pull request is ready for review label Mar 11, 2026
@mlbridge
Copy link

mlbridge bot commented Mar 11, 2026

Webrevs

Copy link
Member

@aivanov-jdk aivanov-jdk 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 to me, except for a minor comment.

for (int i = 0; i < n; i++) {
if (component == invalidComponents.get(i)) {
invalidComponents.remove(i);
return;
Copy link
Member

Choose a reason for hiding this comment

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

I would rather use break here. There's no code that follows, therefore both break and return have the same effect, yet break is safer in my opinion.

@aivanov-jdk
Copy link
Member

@mrserb, please review.

@turbanoff you may be interested, too.

This is the fix to a problem discovered in #24845 (comment).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 11, 2026
@mrserb
Copy link
Member

mrserb commented Mar 11, 2026

Is it possible to cover the patch by the new test?

@aivanov-jdk
Copy link
Member

Is it possible to cover the patch by the new test?

Renjith and I discussed it, and we didn't find a way to reliably test the behaviour. The list is internal to RepaintManager, there's no way to access the list and verify the contents. Nor can I see a way to observe the difference in repaint behaviour.

I'll let Renjith to comment with more details because he's been doing the work.

@Renjithkannath
Copy link
Contributor Author

Hi @mrserb thank you for your time.

Yes I tried to add a verification test on this case but not succeed, same discussed with Alexey. Though addInvalidComponent and removeInvalidComponent methods are public, I could not find a way to add Components into invalidComponents ArrayList and there is no way to check the size of ArrayList before and after add/removal.

If you have any better solution please let me know .

Regards,
Renjith.

@mrserb
Copy link
Member

mrserb commented Mar 13, 2026

Yes I tried to add a verification test on this case but not succeed,

It should be possible: if two invalid but equal components are added to the RepaintManager and one of them is incorrectly removed, you can trigger validateInvalidComponents so that only the component still stored in the RepaintManager will be validated.

@aivanov-jdk
Copy link
Member

Yes I tried to add a verification test on this case but not succeed,

It should be possible: if two invalid but equal components are added to the RepaintManager and one of them is incorrectly removed, you can trigger validateInvalidComponents so that only the component still stored in the RepaintManager will be validated.

You're right. The more I think about it, the surer I am that the issue can be tested.

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

Labels

client [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants