<Swing Dev> [jdk17] RFR: 8269269: [macos11] SystemIconTest fails with ClassCastException
Sergey Bylokhov
serb at openjdk.java.net
Wed Jun 30 04:54:07 UTC 2021
On Wed, 30 Jun 2021 04:23:45 GMT, Alexander Zuev <kizune at openjdk.org> wrote:
>> test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 76:
>>
>>> 74: int[] sizes = new int[] {16, 32, 48, 64, 128};
>>> 75: for (int size : sizes) {
>>> 76: ImageIcon icon = (ImageIcon) fsv.getSystemIcon(file, size, size);
>>
>> Probably we can wrap the "UIManager.getIcon" in the "ImageIcon"?
>
>> Probably we can wrap the "UIManager.getIcon" in the "ImageIcon"?
>
> Why? In some LaFs that might be a procedural image that generates it content every time paint() is called on it - i do not think wrapping it in the ImageIcon will solve anything.
If it is generated every time, then it will be wrapped every time as well. The difference is that it will not be needed to check the type of the icon. Even now, on Windows it is necessary to check is the returned object ImageIcon or not.
-------------
PR: https://git.openjdk.java.net/jdk17/pull/178
More information about the swing-dev
mailing list