On Wed, 27 Jul 2022 04:31:58 GMT, Abhishek Kumar <[email protected]> wrote:

>> JFileChooser - empty file size issue fixed. 
>> For empty file, now the size 0 bytes.
>> Manual Test Case "ZeroFileSizeCheck.java" created.
>
> 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 1193:

> 1191:                 setIcon(icon);
> 1192: 
> 1193:             } else if (value instanceof Long len) {

quick question:
can we use pattern matching (value instanceof Long len) here?  won't this 
create a problem in java8 ?

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.

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

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

Reply via email to