IntelliJ’s default style is mostly compliant with ours but it uses a different import order from ours; hence, some tweaks are needed.
Legend: basic tweak | intermediate tweak | advanced tweak
switch-case style File → Settings… (Windows/Linux), or IntelliJ IDEA → Settings… (macOS).Editor → Code style→ Java (see the screenshot below).
Wrapping and Braces tab and un-tick the Indent 'case' branches option (as shown in the screenshot above).import order File → Settings… (Windows/Linux), or IntelliJ IDEA → Settings… (macOS).Editor → Code Style → Java.Imports tab to set the import order.
You can configure Intellij to automatically strip trailing white space in code lines, as follows:
Settings.Editor -> General.On Save section.Remove trailing spaces on: to Modified lines.The tweaks given above are specific to code style. A few more useful settings (not related to the code style) can be found here.