<Swing Dev> RFR: 6514600: AbstractAction can throw NullPointerException when clone()d

Pankaj Bansal pbansal at openjdk.java.net
Mon Sep 28 09:23:00 UTC 2020


On Mon, 28 Sep 2020 07:52:20 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> Please review a fix for an issue whereby it is seen that AbstractAction which has had its values clear()ed or nulled
> fails to clone and throws NPE. This is because AbstractAction contains an inner class ArrayTable, whose 'table' field
> is lazily instantiated, and nulled on clear(), and thus can be null. The clone() method assumes it is not null.
> Proposed fix is to add a check for null for "table" field in clone().

Looks good to me

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

Marked as reviewed by pbansal (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/377


More information about the swing-dev mailing list