mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IfStatementWithIdenticalBranches: explicit type for array assignment
IDEA-190203
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// "Extract common part with variables from if " "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Main {
|
||||
public static void main(String... args) {
|
||||
int i = 1;
|
||||
String[] array;
|
||||
if (i % 2 == 0) {
|
||||
array = new String[]{};
|
||||
} else {
|
||||
array = new String[]{"not empty"};
|
||||
}
|
||||
main(array);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Extract common part with variables from if " "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Main {
|
||||
public static void main(String... args) {
|
||||
int i = 1;
|
||||
if<caret> (i % 2 == 0) {
|
||||
String[] array = {};
|
||||
main(array);
|
||||
} else {
|
||||
String[] array = {"not empty"};
|
||||
main(array);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user