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

Tejesh R duke at openjdk.java.net
Tue May 31 10:05:41 UTC 2022


On Tue, 31 May 2022 09:57:36 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Ok, then will try with the _bufferedImage paint_ logic, If I'm able to get the exception without it been handled by internal code then it'll be really helpful to make it automatic.
>
>> > _Actually if the current test executes then its a pass right......?_
>> This means, if there is no NPE raised then its a pass case right.......?
> 
> Yes, no NPE means the test passes successfully. If NPE is thrown, the test fails.
> 
>> Yeah to some extent it is automatic, I actually didn't get how to handle the caught NPE, so just left it so that the Test case will be failed by NPE.
> 
> In the majority of cases, you don't want to catch exceptions in tests. No exceptions are usually expected. An exception thrown from main makes the test fail.
> 
> Yet I can't see how it gets thrown from main in this particular case. It's not important, however.

Its not thrown from main I guess, its from internal code when JTable.update is called....... As I can see, painting the table to `BufferedImage` might not raise an exception in this case...... So I think its better to handle it by not handling or re-catching the NPE. I'll just remove the passFailFrame and the test case would be fine with that I guess......?

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

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



More information about the client-libs-dev mailing list