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

Abhishek Kumar duke at openjdk.org
Wed Aug 10 15:48:42 UTC 2022


On Wed, 10 Aug 2022 14:38:57 GMT, Alexey Ivanov <aivanov 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.

Yeah, you are right if we display the file size with _one decimal point precision_ then it is inconsistent. 
I will add the test files for 1 KB and 0.5 KB.

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

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



More information about the client-libs-dev mailing list