mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
invert if: ensure outer if becomes braces when nested if has no else brunch (IDEA-206882)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// "Invert 'if' condition" "true"
|
||||
class Main {
|
||||
void foo(boolean a1, boolean b1){
|
||||
if (a1) {
|
||||
if (!b1) {
|
||||
System.out.println("1");
|
||||
}
|
||||
}
|
||||
else {
|
||||
System.out.println("2");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Invert 'if' condition" "true"
|
||||
class Main {
|
||||
void foo(boolean a1, boolean b1){
|
||||
if (a1)
|
||||
if (b<caret>1) {
|
||||
} else {
|
||||
System.out.println("1");
|
||||
}
|
||||
else {
|
||||
System.out.println("2");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user