On Thu, 1 Apr 2021 13:19:07 GMT, Alexey Ivanov <aiva...@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

Reply via email to