RFR: 8293862: javax/swing/JFileChooser/8046391/bug8046391.java failed with 'Cannot invoke "java.awt.Image.getWidth(java.awt.image.ImageObserver)" because "retVal" is null'
Alexey Ivanov
aivanov at openjdk.org
Thu Jan 4 12:35:36 UTC 2024
On Tue, 2 Jan 2024 17:58:19 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
> Thank you, Karl, for bringing the problem in this PR. It already exist in JBS as [JDK-8320692](https://bugs.openjdk.org/browse/JDK-8320692): _Cannot invoke java.awt.Image.getWidth(java.awt.image.ImageObserver)_.
>
> I added my observations there. The problem is likely applicable to other file types which have per-instance icons, however, these are uncommon with the exception of exe files. The suggested fix won't work, there should be an icon but we have to handle the fallback gracefully.
@DevCharly Although the exception comes from the same code line, the root cause is different. In this PR, the problem was that a valid icon handle had been interpreted as invalid, thus a valid icon wasn't extracted. In case you reference, there's no icon to extract; I expect the shell to fallback to the default app icon automatically, but it doesn't happen, so we have to provide the fallback ourselves.
It is a new case that hasn't been encountered before.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/12010#issuecomment-1877024211
More information about the client-libs-dev
mailing list