On Wed, 7 Feb 2024 16:38:11 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> Renjith Kannath Pariyangad has updated the pull request incrementally with 
>> one additional commit since the last revision:
>> 
>>   Disposed g2D object and similar test parm into one line
>
> test/jdk/java/awt/print/PageFormat/PageSetupDialog.java line 85:
> 
>> 83:         myImageableRightLabel.setText
>> 84:                 ("Format Right Margin = " + (float) 
>> (myPageFormat.getWidth() -
>> 85:                 (myPageFormat.getImageableX() + 
>> myPageFormat.getImageableWidth())));
> 
> ~~This is confusing: the part of the second argument is completely lost out 
> of view. Please avoid such style of wrapping.~~
> 
> I suggest such wrapping:
> Suggestion:
> 
>         myImageableRightLabel.setText("Format Right Margin = "
>                 + (float) (myPageFormat.getWidth()
>                            - (myPageFormat.getImageableX() + 
> myPageFormat.getImageableWidth())));
> 
> 
> Here, the first part of the argument stays on the first line; the string is 
> wrapped at `+` and then the expression is wrapped at `-` before a nested 
> parenthesised expression starts. This way makes it easier to track what is 
> going on.

**Let's leave it as is.** If anyone wants, additional clean up could be 
performed separately.

I believe all the casts to `(float)` are also redundant.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17607#discussion_r1481791502

Reply via email to