Is it possible to tell IntelliJ to put empty block on one line when formatting Java files.
I'd like this:
@Override
public void onClickPositive(int tag, Object payload) {
}
To automatically become this:
@Override
public void onClickPositive(int tag, Object payload) {}
解决方案
There is no way to do it for reformatting code.
This can only be done manually.
Check your Code Style settings, under "Alignment and Braces" to preserve your formatting.
You should find a "Simple methods in one line" option there. Check it and clear the "Line breaks" check box.