Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-24 Thread Sergey Bylokhov
Looks fine. On 19.02.16 12:04, Ajit Ghaisas wrote: Hi, There are the some good points made by Miguel regarding null checks – but, in this case the table being null is a valid case. While rendering the TableHeader, it is possible to be in a situation where ‘table’ parameter can be

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-19 Thread Miguel Munoz
According to the discussion you linked to, "Swing is trying to paint the header you've already removed from the table..." which is why the table is null. This is a good example of my original point. Why is Swing trying to paint a header that has been removed?  In any case, whenever it's not

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-19 Thread Ajit Ghaisas
Hi,      There are the some good points made by Miguel regarding null checks – but, in this case the table being null is a valid case.    While rendering the TableHeader, it is possible to be in a situation where ‘table’ parameter can be null.     Please refer to a similar discussion :

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-18 Thread Miguel Munoz
It would seem to me that if the table is null, you have a bug in another class. Is there a valid reason for the table to be null? I would guess not. In my experience, many null checks are either unnecessary or only serve to hide bugs. Steve Maguire writes about this in his book Writing Solid

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-17 Thread Ajit Ghaisas
Hi, Goods finding Sergey. 1. In file, src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java, call to setText() and setBorder() should be made irrespective of whether table in null or not. I have made this change. 2. The changes to SynthTableHeaderUI.java are

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-17 Thread Sergey Bylokhov
Hi, Hello Ajit. I am not sure that exclusion of the code is a correct fix here. For example can you clarify should we call setText(or other setXXX) when the table is null or not? Another question is: should we skip the code in SynthTableHeaderUI.java or we can assume table==null as enabled

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-17 Thread Rajeev Chamyal
Looks good to me. Regards, Rajeev Chamyal From: Ajit Ghaisas Sent: 17 February 2016 16:51 To: Rajeev Chamyal; Sergey Bylokhov; Alexander Scherbatiy; swing-dev@openjdk.java.net Subject: RE: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-17 Thread Ajit Ghaisas
Hi, I have corrected formatting of test code and removed the additional System.out.printlns. Please review : http://cr.openjdk.java.net/~arapte/ajit/8020039/webrev.02/ Regards, Ajit From: Ajit Ghaisas Sent: Tuesday, February 16, 2016 3:12 PM To: Rajeev Chamyal; Sergey

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-16 Thread Ajit Ghaisas
Hi, Thanks Rajeev for review comments. I have checked - windows LAF WindowsTableHeaderUI handles it correctly. I have added null check for MacOs Aqua. Also, I have added a test checking for this null pointer access. Please review --

Re: [9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-15 Thread Rajeev Chamyal
Hello Ajit, Can you please if similar fix is required for other LAF windows ,Aqua etc. Please add a regression test case also. Regards, Rajeev Chamyal From: Ajit Ghaisas Sent: 15 February 2016 17:30 To: Rajeev Chamyal; Sergey Bylokhov; Alexander Scherbatiy;

[9] Review fix for JDK-8020039 : SynthTableHeaderUI refers to possibly null parameter in cell renderer

2016-02-15 Thread Ajit Ghaisas
Hi, Please review the fix for jdk9, Bug: https://bugs.openjdk.java.net/browse/JDK-8020039 Webrev: http://cr.openjdk.java.net/~arapte/ajit/8020039/webrev.00/ Issue : If null is passed as 'table' parameter to SynthTableHeaderUI::getTableCellRendererComponent()