mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
extract if condition: ensure brackets (IDEA-134698)
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (a)
|
||||
if (b) {
|
||||
System.out.println("a&b");
|
||||
} else {
|
||||
if (c) {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
else if (c) {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (a)
|
||||
if (b) {
|
||||
System.out.println("a&b");
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (a) {
|
||||
System.out.println("a&b");
|
||||
} else if (b) {
|
||||
System.out.println("a&b");
|
||||
} else {
|
||||
if (c) {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (a) {
|
||||
System.out.println("a&b");
|
||||
} else if (b) {
|
||||
System.out.println("a&b");
|
||||
} else {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (a)
|
||||
if (b) {
|
||||
System.out.println("a&b");
|
||||
} else {
|
||||
System.out.println("c");
|
||||
}
|
||||
else {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (<caret>a && b) {
|
||||
System.out.println("a&b");
|
||||
} else if (c) {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (<caret>a && b) {
|
||||
System.out.println("a&b");
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (<caret>a || b) {
|
||||
System.out.println("a&b");
|
||||
} else if (c) {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (<caret>a || b) {
|
||||
System.out.println("a&b");
|
||||
} else {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Extract if (a)" "true"
|
||||
class TestThreadInspection {
|
||||
void f(boolean a, boolean b, boolean c){
|
||||
if (<caret>a && b) {
|
||||
System.out.println("a&b");
|
||||
} else {
|
||||
System.out.println("c");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user