Is IntelliJ a structural replacement to find all if statements without bindings (having only one line if the condition is met) and surround it with curly braces?

How IntelliJ structural substitution is used to find all if statements that have exactly one line (executed when the condition is met)

if (isNice)
   doSomething();

and surround them with curly braces?

if (isNice) {
   doSomething();
}

Amazing but it

if ($expression$)
   $expression2$;

finds if blocks with or without scenes ... although I'm not sure if this is on the right track to start with ...

+4
source share
1 answer

, , . : . , .

+3

Source: https://habr.com/ru/post/1607135/


All Articles