Reputation: 71
I understand that this question has been answered before, but those answers no longer apply to the current version of Eclipse. If this is not the appropriate way to re-ask a question, I apologize in advance.
When I use shift+ctrl+f to reorganize a class I have the following happen to my one-line if statements
if (true) doThis();
changed to
if (true)
doThis();
How can I make shift+ctrl+f auto organize to be like the first statement?
Upvotes: 0
Views: 749
Reputation: 5094
From the menu:
Window -> Preferences
In Preferences:
Java -> Code Style -> Formatter -> Click 'edit'
New Lines -> In control statements -> 'if else' -> Keep simple 'if' on one line
Upvotes: 1