mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 08:09:39 +07:00
Java: Simplify side effects check (IDEA-182669)
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
// "Move 'return' closer to computation of the value of 'n'" "true"
|
||||
class T {
|
||||
int[] f(int k) {
|
||||
int[] n = {-1};
|
||||
if (k == 1)
|
||||
return new int[]{1};
|
||||
return new int[]{-1};
|
||||
return n;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,9 @@ import java.util.*;
|
||||
|
||||
class T {
|
||||
List foo(boolean b) {
|
||||
List n = new ArrayList();
|
||||
if (b)
|
||||
return null;
|
||||
return new ArrayList();
|
||||
return n;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,9 @@ import java.util.*;
|
||||
|
||||
class T {
|
||||
List foo(boolean b) {
|
||||
List n = new ArrayList();
|
||||
if (b)
|
||||
return new ArrayList(1);
|
||||
return new ArrayList();
|
||||
return n;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user