mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-15 02:03:58 +07:00
IDEA-243021 Intention action to duplicate statement(s) into both 'if' branches
GitOrigin-RevId: dd97488c1ffef6880136db2b04052a36287653a6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f61a94b5c9
commit
4440291577
+14
@@ -0,0 +1,14 @@
|
||||
// "Move up into 'if' statement branches" "true"
|
||||
class X {
|
||||
void test(int x) {
|
||||
if (x > 0) {
|
||||
System.out.println(">0");
|
||||
int y = x * 2;
|
||||
System.out.println(y);
|
||||
} else {
|
||||
if (x < 0) {}
|
||||
int y = x * 2;
|
||||
System.out.println(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Move up into 'if' statement branches" "true"
|
||||
class X {
|
||||
void test(int x) {
|
||||
if (x > 0) {
|
||||
System.out.println(x);
|
||||
} else {
|
||||
System.out.println(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -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>
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Move up into 'if' statement branches" "false"
|
||||
class X {
|
||||
void test(int x) {
|
||||
if (x > 0) System.out.println(">0"); else if (x < 0) {}
|
||||
<selection>int y = x * 2;</selection>
|
||||
System.out.println(y);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Move up into 'if' statement branches" "true"
|
||||
class X {
|
||||
void test(int x) {
|
||||
if (x > 0) System.out.println(">0"); else if (x < 0) {}
|
||||
<selection>int y = x * 2;
|
||||
System.out.println(y);</selection>
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Move up into 'if' statement branches" "true"
|
||||
class X {
|
||||
void test(int x) {
|
||||
if (x > 0) {}
|
||||
<caret>System.out.println(x);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user