mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
extract if condition: ensure brackets (IDEA-134698)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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