RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v3]
Abhishek Kumar
duke at openjdk.org
Fri Jul 8 10:34:45 UTC 2022
On Thu, 7 Jul 2022 19:48:55 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Byte entry added to basic.properties, MessageFormat used to format file length
>
> src/java.desktop/share/classes/sun/swing/FilePane.java line 1198:
>
>> 1196: if (listViewWindowsStyle) {
>> 1197: len /= 1024L;
>> 1198: text = MessageFormat.format(kiloByteString, len + 1);
>
> Does it make sense to address this too?
> If len is zero before division, leave it as is so that the size would display "0 KB"; if len is greater than 0, then divide and add 1. At least this is how Windows Explorer displays file sizes.
I guess in listViewWindowsStyle filesize is not shown.
But logically it needs to address too as you suggested, otherwise it will give wrong info.
-------------
PR: https://git.openjdk.org/jdk/pull/9327
More information about the client-libs-dev
mailing list