RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v25]
Phil Race
prr at openjdk.org
Fri Sep 2 00:49:03 UTC 2022
On Fri, 26 Aug 2022 14:30:10 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:
>
> Updated as per suggested changes
AK > Since we are displaying file size in one decimal precision, files having size from 1 to 199 byte will be 0.1 KB.
PR > Yes, I see that. My point is it seems wrong.
AK > Can you please suggest me what should I do to handle 1 byte to199 bytes ?
PR : Just consistently round up
- 0 bytes is 0 kb
- 1-100 bytes is 0.1 kb
- 101-199 bytes is 0.2 kb
- 901 -1000 bytes is 1kb
and so on
-------------
PR: https://git.openjdk.org/jdk/pull/9327
More information about the client-libs-dev
mailing list