How to surround code by curly braces in IntelliJ IDEA? Is there any keyboard-shortcut for such operation?
I had oneline if statement without curly braces and I had to update it with braces in whole file. So I updated code style to always add braces for if/else statement. In Idea go to:
Settings -> Editor -> Code Style -> Java -> Wrapping and Braces (tab)
Find "'If()' Statement"/"Force braces" and change value from "Do not force"(default) to "Always".
Press ctrl + alt + L
to reformat your file and curly braces would be added.
settings