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

8251483: TableCell: NPE on modifying item's list #741

Closed

Conversation

Maran23
Copy link
Member

@Maran23 Maran23 commented Feb 23, 2022

This PR fixes an issue where the item of the table row is null, although the cell itself is not empty (non null value).

The fix is to call indexChanged(..) immediately after the index was changed, but before all indexProperty() listener are notified.
The then notified listener in TableRowSkinBase will update the underlying cells, which will eventually result in an call to updateItem(..), where the NPE happened (and now not anymore, since the table row is now correctly setup before).

There is one special case: When the index didn't changed at all, we manually call indexChanged(..) (just like before) since when a property is not changed, invalidated() is not called, but we need to notify subclasses that updateIndex(..) was called.


Progress

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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 741

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/741.diff

…ing item first before the listener which reacts to the index change are notified.
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 23, 2022

👋 Welcome back mhanl! 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 Ready for review label Feb 23, 2022
@mlbridge
Copy link

mlbridge bot commented Feb 23, 2022

Webrevs

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Feb 23, 2022

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

Copy link
Collaborator

@aghaisas aghaisas 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.

Copy link
Collaborator

@mstr2 mstr2 left a comment

Choose a reason for hiding this comment

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

The changed code makes sense, and fixes the issue.

@openjdk
Copy link

openjdk bot commented Jul 2, 2022

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

8251483: TableCell: NPE on modifying item's list

Reviewed-by: aghaisas, mstrauss

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

  • b3eca1f: 8283346: Optimize observable ArrayList creation in FXCollections
  • 1f62570: 8285253: Update boot JDK to 18.0.1
  • c759286: 8286774: Replace openjdk.java.net with openjdk.org
  • da5bd37: 8277756: DatePicker listener might not be added when using second constructor
  • 864792d: 8284654: Modal behavior returns to wrong stage
  • 83a46e0: 8284665: First selected item of a TreeItem multiple selection gets removed if new items are constantly added to the TreeTableView
  • f534850: 8088420: JavaFX WebView memory leak via EventListener
  • d677003: 8286256: Update libxml2 to 2.9.14
  • 19a855e: 8286261: Selection of non-expanded non-leaf treeItem grows unexpectedly when adding two-level descendants
  • 18b2366: 8285197: TableColumnHeader: calc of cell width must respect row styling (TreeTableView)
  • ... and 50 more: https://git.openjdk.org/jfx/compare/adf1da42de07aba5af07c67a4e756db52203256d...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.

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 (@aghaisas) 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 openjdk bot added the ready Ready to be integrated label Jul 2, 2022
@Maran23
Copy link
Member Author

Maran23 commented Jul 4, 2022

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Jul 4, 2022
@openjdk
Copy link

openjdk bot commented Jul 4, 2022

@Maran23
Your change (at version 23921bf) is now ready to be sponsored by a Committer.

@aghaisas
Copy link
Collaborator

aghaisas commented Jul 5, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 5, 2022

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

  • b3eca1f: 8283346: Optimize observable ArrayList creation in FXCollections
  • 1f62570: 8285253: Update boot JDK to 18.0.1
  • c759286: 8286774: Replace openjdk.java.net with openjdk.org
  • da5bd37: 8277756: DatePicker listener might not be added when using second constructor
  • 864792d: 8284654: Modal behavior returns to wrong stage
  • 83a46e0: 8284665: First selected item of a TreeItem multiple selection gets removed if new items are constantly added to the TreeTableView
  • f534850: 8088420: JavaFX WebView memory leak via EventListener
  • d677003: 8286256: Update libxml2 to 2.9.14
  • 19a855e: 8286261: Selection of non-expanded non-leaf treeItem grows unexpectedly when adding two-level descendants
  • 18b2366: 8285197: TableColumnHeader: calc of cell width must respect row styling (TreeTableView)
  • ... and 50 more: https://git.openjdk.org/jfx/compare/adf1da42de07aba5af07c67a4e756db52203256d...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 5, 2022
@openjdk openjdk bot closed this Jul 5, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review sponsor Ready to sponsor labels Jul 5, 2022
@openjdk
Copy link

openjdk bot commented Jul 5, 2022

@aghaisas @Maran23 Pushed as commit 222b2b1.

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

@Maran23 Maran23 deleted the 8251483-null-item-of-table-row branch July 5, 2022 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
4 participants