RFR: 8256283: IndexOutOfBoundsException when sorting a TreeTableView [v2]

Ambarish Rapte arapte at openjdk.java.net
Thu Jan 28 11:48:02 UTC 2021


> This particular issue JDK-8256283, is a specific case of IOOBE when, rootItem is not shown, some children including first child are selected, then all children are removed and sort() is invoked. The sort() fails with an IOOBE.
> This PR only addresses this specific IOOBE.
> Root cause of this issue is that the selection is not cleared after rootItems children are removed. In addition to this, there are few other scenarios when selection is not updated correctly, which are collected under an umbrella task [JDK-8248217](https://bugs.openjdk.java.net/browse/JDK-8248217). Fix for [JDK-8248217](https://bugs.openjdk.java.net/browse/JDK-8248217) would require good amount refactoring of selection model.
> 
> The fix for this issue is to avoid sort() when rootItem.getChildren().isEmpty().
> Added a unit test with the fix, which fails without fix and passes with fix.

Ambarish Rapte has updated the pull request incrementally with one additional commit since the last revision:

  Review correction

-------------

Changes:
  - all: https://git.openjdk.java.net/jfx/pull/384/files
  - new: https://git.openjdk.java.net/jfx/pull/384/files/f1e6c63a..89da162b

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jfx&pr=384&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jfx&pr=384&range=00-01

  Stats: 8 lines in 2 files changed: 7 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jfx/pull/384.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/384/head:pull/384

PR: https://git.openjdk.java.net/jfx/pull/384


More information about the openjfx-dev mailing list