JDK-8266539 : [TreeView]: Change.getRemoved() contains null item when deselecting a TreeItem
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8,openjfx16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-05-05
  • Updated: 2021-06-01
  • Resolved: 2021-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
openjfx17Fixed
Related Reports
Relates :  
Description
When deselecting a TreeItem, the Change.getRemoved() contains a null entry. Instead it should contain only the item that was deselected.

Steps:
1. Run the attached test program
2. Select child item of root
3.Ctrl/Command click the same item to deselect it
-> Observe the NPE that occurs because Change.getRemoved() contains a null entry

The issue was also discussed in the review of JDK-8189354 at PR#480.
The PR#480 had a change in MultipleModelSelectionModelBase.java that could fix this issue but it was reverted to limit the scope PR#480
The reverted commit: https://github.com/openjdk/jfx/pull/480/commits/923f8d74039780065b02ac23d605cc010fde43b3
Comments
Changeset: f236a7dc Author: Michael Strau�� <mstrauss@openjdk.org> Committer: Ambarish Rapte <arapte@openjdk.org> Date: 2021-05-17 12:55:19 +0000 URL: https://git.openjdk.java.net/jfx/commit/f236a7dcb231c0b87d4499158adc500ed06e5178
17-05-2021