<AWT Dev> RFR: 8182043: Access to Windows Large Icons [v15]
Alexander Zuev
kizune at openjdk.java.net
Wed May 26 21:42:19 UTC 2021
On Wed, 26 May 2021 21:12:16 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Alexander Zuev has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Fixed small errors
>> Adjustments in the test
>> - Grammar fix in method documentation
>
> test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 77:
>
>> 75: int[] sizes = new int[] {16, 32, 48, 64, 128};
>> 76: for (int size : sizes) {
>> 77: ImageIcon icon = (ImageIcon) fsv.getSystemIcon(file, size, size);
>
> Is this cast allowed without instanceof check?
On Windows - yes. When implementation is complete on other platforms test will have to be updated depending on the way it will be implemented there.
> test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 87:
>
>> 85: }
>> 86:
>> 87: if (implComplete && icon.getIconWidth() != size) {
>
> Why the size of the returned images might be different? The spec state the size parameter in the getSystemIcon is the size of the icon in the userspace.
The spec says that we are taking into consideration requested sizes but depending on the platform implementation exact match can not be guaranteed. On Windows it can so i'm checking for that.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2875
More information about the awt-dev
mailing list