RFR: 8254861: reformat code in vmTestbase/nsk/jdb [v2]
Chris Plummer
cjplummer at openjdk.java.net
Wed Oct 21 20:15:14 UTC 2020
On Tue, 20 Oct 2020 00:21:14 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:
>> I don't follow. You seem to have added an extra 4 (after having already indented 4 extra spaces) simply because it is an array initialization. Why is the indentation any different than it would be for something like a "for" loop block. The body of the block is indented 4 spaces more than the "for" statement. For the static initialization the body of that "static" block should be indented 4 more than the "static" statement. I don't see anything in the style guide that would indicate otherwise.
>
> oh, sorry, it appears I was trying to explain the new code while looking at the old one...
>
> full disclaimer, which I thought was obvious, the vast majority of the changes here aren't done by me, they are done by auto-formatter, or more precisely by IntelliJ IDEA's formatter. IDEA doesn't consider array initialization as a new block, and what's actually at play here is an indent for statement continuation (which is 2x of regular indent).
Do you plan on leaving these indented 8 instead of 4 because that's what IDEA defaults to? Other editors, like emacs, will want to indent them 4, and will do so often do so automatically just by editing the line, depending on whether you type any character that forces reformatting of indentation.
Do we have coding guidelines that say to indent them 8?
-------------
PR: https://git.openjdk.java.net/jdk/pull/689
More information about the serviceability-dev
mailing list