mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
IDEA-179128 Quick-fix for "'if' statement has empty body"
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
// "Delete element" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Delete element" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
if(x > -5) {
|
||||
System.out.println("ok");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Extract side effects as an 'if' statement" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
if (x > 0) {
|
||||
foo(x, 1);
|
||||
foo(x, 2);
|
||||
} else {
|
||||
foo(x, 3);
|
||||
}
|
||||
}
|
||||
|
||||
boolean foo(int x, int y) {
|
||||
System.out.println(x);
|
||||
return x > y;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Extract side effects" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
if(x > 0) {
|
||||
foo(x, 1);
|
||||
foo(x, 2);
|
||||
}
|
||||
}
|
||||
|
||||
boolean foo(int x, int y) {
|
||||
System.out.println(x);
|
||||
return x > y;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Delete element" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Delete element" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
i<caret>f(x > 0) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Delete element" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
if(x > -5) {
|
||||
System.out.println("ok");
|
||||
} else i<caret>f(x > 0) {} else {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Delete element" "false"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
if(x > -5) {
|
||||
System.out.println("ok");
|
||||
} else i<caret>f(x > 0) {} else {
|
||||
System.out.println("not ok");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Extract side effects as an 'if' statement" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
i<caret>f(x > 0 ? !foo(x, 1) ^ foo(x, 2) : foo(x, 3)) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
boolean foo(int x, int y) {
|
||||
System.out.println(x);
|
||||
return x > y;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Extract side effects" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
if(x > 0)
|
||||
i<caret>f(!foo(x, 1) ^ foo(x, 2)) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
boolean foo(int x, int y) {
|
||||
System.out.println(x);
|
||||
return x > y;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Delete element" "true"
|
||||
class Test {
|
||||
void test(int x) {
|
||||
s<caret>witch(x*2) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user