On Thu, 11 Aug 2022 19:11:28 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> Abhishek Kumar has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Smaller file sizes display one decimal precision
>
> src/java.desktop/share/classes/sun/swing/FilePane.java line 1199:
> 
>> 1197:             } else if (value instanceof Long len) {
>> 1198:                 if (listViewWindowsStyle) {
>> 1199:                     updateMessageFormatPattern(kiloByteString, 1);
> 
> Now you always call `updateMessageFormatPattern` with 1 as the second 
> parameter. Maybe you could initialise both MessageFormat and NumberFormat 
> once and then just use the objects. Or switch back to `MessageFormat.format` 
> method.

MessageFormat.format method was truncating "0" from values like "0.0", "1.0" 
and so on.
Due to that I initialize MessageFormat and NumberFormat instance.

The first parameter in updateMessageFormatPattern  method changes based on file 
size, so calling it multiple times to update the pattern.
The second parameter can be removed.

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

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

Reply via email to