Lets you print certain statements on just one line when possible, i.e. if they don't exceed the maximal line length.
When enabled, prints single if statements in one line when possible.
Since 1.2
When enabled, prints the if part of if/else statements in one line when possible.
Since 1.2
Please note that when the if part has been printed on one line, the following else if or else part always starts on a new line.
When enabled, prints the else if part of if/else statements in one line when possible.
Example 2.11. Standard else of if/else block
if (cond1) | return getMagicNumber(); | else if (cond2) | throw new IllegalStateException(); |
Example 2.12. Compact else if block
if (cond1) | return getMagicNumber(); | else if (cond2) throw new IllegalStateException(); |
Please note that when the else if part has been printed on one line, the following else part always starts on a new line.
Since 1.2
Example 2.13. Compact if block
if (cond1) | return getMagicNumber(); | else if (cond2) throw new IllegalStateException(); | else | return 0; |
When enabled, prints the else part of if/else statements on one line when possible.
Since 1.2
Example 2.14. Standard else block
if (cond1) | return getMagicNumber(); | else if (cond2) | throw new IllegalStateException(); | else | return 0 |
Example 2.15. Compact else block
if (cond1) | return getMagicNumber(); | else if (cond2) | throw new IllegalStateException(); | else return 0; |
You can narrow the scope for the above mentioned options by selecting whether all statements should be printed on one line when possible or only throw or return statements.
Since 1.2