RFR: 6429812: NPE after calling JTable.updateUI() when using a header renderer + XP L&F [v7]
Alexey Ivanov
aivanov at openjdk.java.net
Tue Jun 7 11:47:27 UTC 2022
On Mon, 6 Jun 2022 06:16:16 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).
test/jdk/javax/swing/JTableHeader/TableRendererTest.java line 31:
> 29: @summary Test to check if table is printed without NPE
> 30: @run main TableRendererTest
> 31: */
Could you move the test tags below the imports?
Most new tests follow this style and I find it more convenient when viewing the test source in the IDE, the test tags aren't collapsed this way.
Please add asterisk at the beginning of each line. It should look like this:
/*
* @test
* @bug
*/
To follow the common style of Java block comments and test tags in the majority of files.
Please do not use `/**` as the first comment: it's not a Javadoc comment to avoid warning about the unknown javadoc tags.
test/jdk/javax/swing/JTableHeader/TableRendererTest.java line 47:
> 45: import javax.swing.table.TableCellRenderer;
> 46:
> 47: public class TableRendererTest{
I suggest making the name more specific: `TableHeaderRendererTest` or `TableHeaderRendererNPETest`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8830
More information about the client-libs-dev
mailing list