RFR: 8283215: [macos] Screen Magnifier: Getting java.awt.IllegalComponentStateException when menu item is selected [v2]

Sergey Bylokhov serb at openjdk.java.net
Tue Mar 29 22:02:51 UTC 2022


On Tue, 29 Mar 2022 17:39:25 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 472:
>> 
>>> 470:         return invokeAndWait(new Callable<Accessible>() {
>>> 471:             public Accessible call() throws Exception {
>>> 472:                 if (parent == null || !parent.isVisible()) {
>> 
>> Should the `isShowing` be used here to check containers up to the top level? But I think it should be possible to create a test that may trigger an exception in `getLocationOnScreen()` after the check, so maybe try/catch will be a better approach.
>
> Well, if the parent is visible then it is all we need to get its screen coordinates. But i also think that surrounding the entire call in try/catch block would work better. Updating the fix.

Why do you need to wrap the entire call, can this exception be thrown by some other methods?

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

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



More information about the client-libs-dev mailing list