RFR: 6429812: NPE after calling JTable.updateUI() when using a header renderer + XP L&F [v11]

Alexey Ivanov aivanov at openjdk.java.net
Wed Jun 8 11:44:36 UTC 2022


On Wed, 8 Jun 2022 11:40:25 GMT, Tejesh R <tr at openjdk.org> wrote:

>> _Header_ object not initialized/set when paint() method of `WindowTableHeaderUI` class is executed. The paint() event is executed through explicit call of `JTable.updateUI()` in the regression test. In order to set the _header_ to the _called_ JTable, it is set in the `getTableCellRendererComponent()` method, which in turn makes the _header_ object available during paint event without causing NPE.
>
> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Updated based on review comments

Changes requested by aivanov (Reviewer).

src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java line 2:

> 1: /*
> 2:  * Copyright (c) 1997, 2014, 2022, Oracle and/or its affiliates. All rights reserved.

Suggestion:

 * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.

Nope, you don't add another year, you just modify the second year to the current one.

If the file has only one year, then you add the second one.

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

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



More information about the client-libs-dev mailing list