RFR: 6429812: NPE after calling JTable.updateUI() when using a header renderer + XP L&F [v3]
Alexey Ivanov
aivanov at openjdk.java.net
Tue May 31 09:33:49 UTC 2022
On Tue, 31 May 2022 03:58:04 GMT, Tejesh R <duke at openjdk.java.net> wrote:
> Yeah, wanted to change to automatic, but wasn't sure about whether its ok for NPE check or not.
What can be wrong with it? It's just a regular test. If you can automate the test, you should.
> Actually if the current test executes then its a pass right......?
I don't understand your question, sorry. What surprises me is that the test fails automatically without the fix. But I can't see how the NPE is re-thrown on the main thread.
I thought the NPE would be just printed in the jtreg log file and the tester wouldn't even see it.
So your test is already automated to some extent. What we want is to make it pass automatically if NPE isn't thrown.
> Painting it to bufferedImage and then catching NPE is required........?
No, it's not, however, I think it's a more effective way than showing UI. The exception occurs when `paint` is called. Painting to `BufferedImage` gives you control when and how `paint` is called: you do it _explicitly_. So you wrap the call to `paint` in a try-catch block, if the exception is thrown you re-throw it on main thread to fail the test; if the exception isn't thrown, the test completed successfully. Perhaps, try-catch block isn't necessary, just let the exception propagate.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8830
More information about the client-libs-dev
mailing list