<AWT Dev> RFR: 8182043: Access to Windows Large Icons [v10]

Sergey Bylokhov serb at openjdk.java.net
Thu May 20 17:36:37 UTC 2021


On Thu, 20 May 2021 17:25:33 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java line 72:
>> 
>>> 70:             if (icon.getImage() instanceof MultiResolutionImage) {
>>> 71:                 MultiResolutionImage mri = (MultiResolutionImage) icon.getImage();
>>> 72:                 if (mri.getResolutionVariant(size, size) == null) {
>> 
>> This is to describe one of my questions above, is this instanceof+cast cannot be improved? Why we cannot always wrap the data in the MRI and if we have only one icon return the MRI with one resolution?
>
>> This is to describe one of my questions above, is this instanceof+cast cannot be improved? Why we cannot always wrap the data in the MRI and if we have only one icon return the MRI with one resolution?
> 
> No because in specification we say that we do not guarantee the the icon returned will be MRI. We know how it works on Windows so we test it this way.

Here I am not talking about specification, I am talking about the usage of it, is the instanceof+cast is helpful? It does not look good, why we cannot always return MRI?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2875


More information about the awt-dev mailing list