IDEA-218391 Transform to single return: remove excessive braces in if-else chains.

GitOrigin-RevId: b13d36218843ae5ff7fbfbcadc898113ad4c9bc1
This commit is contained in:
Tagir Valeev
2019-07-16 15:01:49 +03:00
committed by intellij-monorepo-bot
parent 6a06cd749a
commit 50ff44aebd
5 changed files with 40 additions and 29 deletions
@@ -12,12 +12,10 @@ class Test {
s = arr[1];
if (s == null) {
result = false;
} else {
if (arr.length > 3) {
s = arr[2];
if (s != null && s.isEmpty()) {
result = false;
}
} else if (arr.length > 3) {
s = arr[2];
if (s != null && s.isEmpty()) {
result = false;
}
}
}
@@ -8,12 +8,10 @@ class Test {
} else {
result = 4;
}
} else if (s.isEmpty()) {
result = 3;
} else {
if (s.isEmpty()) {
result = 3;
} else {
System.out.println(s);
}
System.out.println(s);
}
return result;
}
@@ -5,12 +5,10 @@ class Test {
synchronized (this) {
if (x == 0) {
result = "foo";
} else if (x == 1) {
result = "bar";
} else {
if (x == 1) {
result = "bar";
} else {
result = "baz";
}
result = "baz";
}
}
return result;
@@ -5,10 +5,8 @@ class Test {
synchronized (this) {
if (x == 0) {
result = "foo";
} else {
if (x == 1) {
result = "bar";
}
} else if (x == 1) {
result = "bar";
}
}
if (result == null) {