Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8092558

[TableTreeView] TreeTableView's selectedItems reports the addition of null items.

XMLWordPrintable

      There are some cases where a TreeTableView's selectedItems will report the addition of null items. Here is a sample case:

      https://gist.github.com/ryanjaeb/dc396c57614fa8c3e1a7

      Steps to reproduce:

      1. Run the example using 8u20-b17.
      2. Sort the "name" column twice so the order is "two, three, one".
      3. Expand item "two".

      You'll get the following output.

      // step 1
      Change event...
       Change:
        Added: one

      // step 2
      Change event...
       Change:
      Change event...
       Change:
        Added: one
      Change event...
       Change:
      Change event...
       Change:
        Added: one
      Change event...
       Change:
      Change event...
       Change:
        Added: one
      Change event...
       Change:
      Change event...
       Change:
        Added: one

      // step 3
      Change event...
       Change:
      Change event...
       Change:
        Added: one
      Change event...
       Change:
      Change event...
       Change:
        WARNING: Added item was null.

      Note the reported addition of a null item. This does not happen with 8u5:

      1. Run the same example with 8u5.
      2. Ensure "one" is selected.
      3. Sort the "name" column twice so the order is "two, three, one".
      4. Expand the "two" item.

      You'll get the following output:

      // step 1
      // step 2
      Change event...
       Change:
        Added: one

      // step 3
      Change event...
       Change:
      Change event...
       Change:
        Added: one
      Change event...
       Change:
      Change event...
       Change:
        Added: one

      // step 4
      Change event...
       Change:
      Change event...
       Change:
        Added: one

      Note the difference. Also note there are fewer events using 8u5.

            jgiles Jonathan Giles
            rjaebjfx Ryan Jaeb (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: