RFR: 8283215: [macos] Screen Magnifier: Getting java.awt.IllegalComponentStateException when menu item is selected [v2]
Alexander Zuev
kizune at openjdk.java.net
Tue Mar 29 17:45:32 UTC 2022
On Tue, 29 Mar 2022 02:47:05 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Surrounding the entire call block with try/catch for illegal component state exception.
>
> 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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8008
More information about the client-libs-dev
mailing list