Re: RFR: 8251483: TableCell: NPE on modifying item's list [v2]

2022-02-23 Thread Marius Hanl
> 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(..)` (basically just like before) since when a property is 
> not changed, `invalidated()` is not called, but we need to notify subclasses 
> that `updateIndex(..)` was called.

Marius Hanl has updated the pull request incrementally with one additional 
commit since the last revision:

  8251483: Updated copyright year

-

Changes:
  - all: https://git.openjdk.java.net/jfx/pull/741/files
  - new: https://git.openjdk.java.net/jfx/pull/741/files/5f65b82c..23921bf2

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

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jfx/pull/741.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/741/head:pull/741

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


RFR: 8251483: TableCell: NPE on modifying item's list

2022-02-23 Thread Marius Hanl
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(..)` (basically just like before) since when a property is 
not changed, `invalidated()` is not called, but we need to notify subclasses 
that `updateIndex(..)` was called.

-

Commit messages:
 - 8251483: indexChanged(..) is now called earlier to update the underlying 
item first before the listener which reacts to the index change are notified.

Changes: https://git.openjdk.java.net/jfx/pull/741/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=741&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8251483
  Stats: 75 lines in 3 files changed: 67 ins; 0 del; 8 mod
  Patch: https://git.openjdk.java.net/jfx/pull/741.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/741/head:pull/741

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