On Wed, 26 May 2021 21:12:16 GMT, Sergey Bylokhov <s...@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

Reply via email to