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

Abhishek Kumar duke at openjdk.org
Thu Jul 28 16:21:56 UTC 2022


On Wed, 27 Jul 2022 15:18:24 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   space added as per review comment
>
> src/java.desktop/share/classes/sun/swing/FilePane.java line 1205:
> 
>> 1203:                 } else {
>> 1204:                     double kbVal = formatToDoubleValue(len);
>> 1205:                     len = (long)kbVal;
> 
> This code still looks sus to me - there is no need to assign len (it goes out of scope pretty quickly) and formatToDoubleValue() should just format and return a formatted String.

As the returned value has been used in comparison with 1000.0 , so returning a double value from formatToDoubleValue().

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

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



More information about the client-libs-dev mailing list