MoveIntoIfBranchesAction: conflict detection improved

GitOrigin-RevId: bf8c3d050e5cfa51e71d6e34921ab2c2036b8e5e
This commit is contained in:
Tagir Valeev
2020-06-15 10:59:08 +03:00
committed by intellij-monorepo-bot
parent f46f7b77b9
commit 8a7d1000b1
4 changed files with 47 additions and 7 deletions
@@ -0,0 +1,10 @@
// "Move up into 'if' statement branches" "false"
class X {
void test(int x) {
if (x > 0) System.out.println(">0"); else {
int y = 3;
}
<selection>{int y = x * 2;
System.out.println(y);}</selection>
}
}
@@ -0,0 +1,9 @@
// "Move up into 'if' statement branches" "false"
class X {
void test(int x, Object obj) {
if (x > 0) System.out.println(">0"); else {
int y = 3;
}
<selection>if (obj instanceof String y) {}</selection>
}
}