IDEA-130782 make RemoveUnusedVariableUtil#checkSideEffects Contract(pure) aware

This commit is contained in:
Alexey Kudravtsev
2014-10-08 15:01:58 +04:00
parent b9bfd33c9b
commit fc68d2a0d6
9 changed files with 167 additions and 155 deletions
@@ -4,7 +4,8 @@ import java.io.*;
class a {
int k;
private void run() {
<caret>while (1 > 0) ;
k = 9;
while (1 > 0) ;
for (;; ) ;
}
}
@@ -0,0 +1,13 @@
// "Remove variable 'i'" "true"
import org.jetbrains.annotations.Contract;
class a {
private void run() {
}
@Contract(pure = true)
private Object dodo() {
return null;
}
}
@@ -0,0 +1,14 @@
// "Remove variable 'i'" "true"
import org.jetbrains.annotations.Contract;
class a {
private void run() {
Object <caret>i = dodo();
}
@Contract(pure = true)
private Object dodo() {
return null;
}
}