Community
Participate
Working Groups
void a() { if (true) System.out.println("a"); else System.out.println("b"); } @@@@ Java Code Conventions: void a() { if (true) System.out.println("a"); else System.out.println("b"); } @@@@ The snipped should not have been formatted. Apparently the first "if" is considered a guardian clause -- which it is not.
bug 49482 is similar
No, this is not a guardian clause, but the option keep then statement on the same line is checked by default in the Java conventions settings. I will change it to false.
Changing this settings to false fixed the problem. Fixed and released in HEAD. Regression test added.
Verified for 3.0-M7 with build I200402102000.