EquivalenceChecker: flexible modifier list comparison; fixes in class comparison; test (IDEA-CR-38140)

This commit is contained in:
Tagir Valeev
2018-10-30 16:55:52 +07:00
parent a965766410
commit 0b7b15f8ac
3 changed files with 64 additions and 8 deletions
@@ -0,0 +1,18 @@
// "Collapse if statement " "true"
import java.util.List;
import java.util.Map;
public class Main {
void test(int x) {
Runnable r = new Runnable() {
private final boolean field = x > 1;
@Override
public void run() {
System.out.println((x));
}
};
}
}
@@ -0,0 +1,29 @@
// "Collapse if statement " "true"
import java.util.List;
import java.util.Map;
public class Main {
void test(int x) {
if<caret>(x > 0) {
Runnable r = new Runnable() {
private final boolean field = x > 1;
@Override
public void run() {
System.out.println((x));
}
};
} else {
Runnable r = new Runnable() {
final private boolean field = 1 < x;
@Override
public void run() {
System.out.println(x);
}
};
}
}
}