Skip to content
Advertisement

Rearrange modifier keywords in IntelliJ

Is there any way to automatically rearrange modifier keywords in IntelliJ?

For example, if I have the following code:

JavaScript

Rearrange it to:

JavaScript

Advertisement

Answer

Go to Settings and enable the Editor | Inspections | Java | Code style issues | Missorted modifiers inspection. It has a quick fix to sort the modifiers. This inspection is also part of Analyze | Code Cleanup…, so another solution would be to invoke that on your code.

Advertisement