[OpenJDK 2D-Dev] RFR: 8263984: Invalidate printServices when there are no printers [v2]

Alexey Ivanov aivanov at openjdk.java.net
Thu Apr 1 13:32:24 UTC 2021


On Thu, 1 Apr 2021 13:19:07 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> I would prefer if you revert this line or if we want to put emphasis on readability moving '{' to new line also seems fine.
>
>> By mapping i mean same indentation for all conditions in if statement…
> 
> Okay, it's the first time I've come across to such a use of `map`.
> 
>> I have not come across code in java.desktop where we add indentation at each continuation line of 'if' condition.
> 
> Take a look at [DefaultTableCellRenderer.getTableCellRendererComponent](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/table/DefaultTableCellRenderer.java#L201).
> 
>> I understand difficulty to scan without indentation but then in cases where we have multiple lines on continuation line in if statement we will easily hit 80 characters limit.
> 
> What is more important code readability or the strict limit of 80 columns?
> 
> All in all, all these styles are used throughout `java.desktop` module.
> I chose to opt for readability in this particular case and the line fits into 80 column limit.
> 
> Do I revert the change to this line?
> Any other suggestions? What is your preference?

> I would prefer if you revert this line or if we want to put emphasis on readability moving '{' to new line also seems fine.

Done.

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

PR: https://git.openjdk.java.net/jdk/pull/3151


More information about the 2d-dev mailing list