RFR: 8269871: CellEditEvent: must not throw NPE in accessors

Jeanette Winzenburg fastegal at openjdk.java.net
Thu Aug 26 14:14:40 UTC 2021


The issue is unguarded access to tablePosition though it might be null (since [JDK-8120610](https://bugs.openjdk.java.net/browse/JDK-8120610)

The fix is to check against null in each accessor. Also required to fix the default onEditCommit handlers in Tree/TableColumn to really cope with null TablePostion on the event.

Added tests that failed/pass before/after the fix.

Note that there was an old test (in Tree/TableColumnTest each), that failed after the fix because it expected the NPE. Fixed by removing the expected parameter.

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

Commit messages:
 - 8269871: CellEditEvent: must not throw NPE in accessors

Changes: https://git.openjdk.java.net/jfx/pull/611/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=611&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8269871
  Stats: 413 lines in 6 files changed: 393 ins; 5 del; 15 mod
  Patch: https://git.openjdk.java.net/jfx/pull/611.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/611/head:pull/611

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


More information about the openjfx-dev mailing list