RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v24]

Alexey Ivanov aivanov at openjdk.org
Fri Aug 26 13:59:19 UTC 2022


On Thu, 25 Aug 2022 04:43:58 GMT, Abhishek Kumar <duke at openjdk.org> wrote:

>> JFileChooser - empty file size issue fixed. 
>> For empty file, now the size 0 KB.
>> Manual Test Case "FileSizeCheck.java" created.
>
> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Comments modified and formatToDoubleValue method name renamed

Changes requested by aivanov (Reviewer).

src/java.desktop/share/classes/sun/swing/FilePane.java line 1200:

> 1198:                 /*
> 1199:                  * This code block is relevant to Linux.
> 1200:                  * File size is displayd up to 1 decimal precision.

Suggestion:

                 * File size is displayed up to 1 decimal precision.

src/java.desktop/share/classes/sun/swing/FilePane.java line 1266:

> 1264:         /**
> 1265:          * Rounds a value to one decimal place. It's used to format
> 1266:          * file size similar to how it's formatted in file managers on Linux.

Does it make sense to add an example?

         * For example, the file size of 1200 bytes is rounded to 1.2 KB.

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

PR: https://git.openjdk.org/jdk/pull/9327



More information about the client-libs-dev mailing list