mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
IDEA-130782 make RemoveUnusedVariableUtil#checkSideEffects Contract(pure) aware
This commit is contained in:
+2
-1
@@ -4,7 +4,8 @@ import java.io.*;
|
||||
class a {
|
||||
int k;
|
||||
private void run() {
|
||||
<caret>while (1 > 0) ;
|
||||
k = 9;
|
||||
while (1 > 0) ;
|
||||
for (;; ) ;
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user