extract if condition: ensure brackets (IDEA-134698)

This commit is contained in:
Anna Kozlova
2014-12-29 18:35:18 +01:00
parent 25dd5b4814
commit 92bb2b6d65
12 changed files with 147 additions and 4 deletions

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}