RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v15]
Alexey Ivanov
aivanov at openjdk.org
Wed Aug 10 14:40:59 UTC 2022
On Wed, 10 Aug 2022 14:19:45 GMT, Abhishek Kumar <duke at openjdk.org> wrote:
> > I wonder how the file size of 200 bytes is shown: 1 KB or 0.2 KB.
>
> As of now files having size >0 and <1000 bytes are shown as 1.0 KB.
And this seems wrong and inconsistent, doesn't it?
If we display the file size with _one decimal point precision_, then it doesn't hold at all until the file size reaches 1 KB.
Whatever the decision we make, I'd like to have a test for 1 KB file and for 0.5 KB file to document how it works. It's the point of having different file sizes in the test, right?
I agree the file sizes less than 1 KB are somewhat uncommon, I'm okay with displaying them as 1.0 KB.
-------------
PR: https://git.openjdk.org/jdk/pull/9327
More information about the client-libs-dev
mailing list