fix psi invalidation on invert if condition (IDEA-192532)

This commit is contained in:
Anna Kozlova
2018-05-24 15:29:41 +03:00
parent 675c30c80f
commit 6c127367b9
3 changed files with 35 additions and 1 deletions
@@ -0,0 +1,19 @@
// "Invert 'if' condition" "true"
class A {
public void annotate() {
if (!equals(2)) {
annotation.registerFix(new IntentionAction() {
public void invoke() throws IncorrectOperationException {
}
});
annotation.registerFix(new IntentionAction() {
public <IncorrectOperationException> void invoke() throws IncorrectOperationException {
}
});
}
else {
return;
}
}
}
@@ -0,0 +1,15 @@
// "Invert 'if' condition" "true"
class A {
public void annotate() {
<caret>if (equals(2)) return;
annotation.registerFix(new IntentionAction() {
public void invoke() throws IncorrectOperationException {
}
});
annotation.registerFix(new IntentionAction() {
public <IncorrectOperationException> void invoke() throws IncorrectOperationException {
}
});
}
}