One Line if statements - Don't add extra line
Desired :
if(something) doSomething()
Formatter updates it to :
if(something)
doSomething()
Neither of these are actually compliant with Google Java Style, which is what google-java-format generates, but the second one is closer (within g-j-f's constraint of only modifying whitespace).
As per https://google.github.io/styleguide/javaguide.html#s4.1-braces and https://google.github.io/styleguide/javaguide.html#s4.3-one-statement-per-line, the required format to adhere to Google Java Style is
if (something) {
doSomething();
}
but the second one is closer (within g-j-f's constraint of only modifying whitespace)
I agree that the second one is closer. However, it seems to me that the first one is what actually happens, at least with versions 1.13.0 and 1.18.1 under Eclipse - the formatter removes the linebreak and shoves it all into a single line.
(I also agree that brackets are what is "correct" according to the Google Java Style, but as the formatter needs to do something with the statement it should probably do the closer variant)