<Swing Dev> [14] RFR JDK-8230235 - Rendering HTML with empty img attribute and documentBaseKey cause Exception
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Thu Oct 31 19:53:13 UTC 2019
On 10/31/19 5:59 am, Pankaj Bansal wrote:
> << I guess that the problem is that the "image" is accessed w/o synchronization on "this" like in other places, but it will be necessary to add one null check before usage of "image".
> I have updated the code to access image with synchronization. But that does not solve the issue. So I have kept the null check also. I tried to add the null check before calling getWidth, calling getWidth still makes the image null. So the check before calling getHeight is still required.
You need to read the image to the local var under synchronization and then get W/H from the local image variable.
I guess in this case both W/H will be 0 since error is occured?
--
Best regards, Sergey.
More information about the swing-dev
mailing list