mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-15 11:58:18 +07:00
IDEA-218391 Transform to single return: remove excessive braces in if-else chains.
GitOrigin-RevId: b13d36218843ae5ff7fbfbcadc898113ad4c9bc1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6a06cd749a
commit
50ff44aebd
+4
-6
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -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;
|
||||
}
|
||||
|
||||
+3
-5
@@ -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;
|
||||
|
||||
+2
-4
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user