IDEA-223743 - changed expression comparison method

GitOrigin-RevId: df87941471af933f4582d8525af0b96885ad3ee5
This commit is contained in:
Ilyas Selimov
2020-06-09 11:09:45 +03:00
committed by intellij-monorepo-bot
parent f10317e766
commit 47b41f6465
@@ -657,7 +657,7 @@ public class ForCanBeForeachInspection extends BaseInspection {
private boolean isInsideTryBlock(@NotNull PsiExpression methodExpression) {
PsiElement parent = methodExpression.getParent();
while (parent != null) {
if (parent.isEquivalentTo(context)) return false;
if (parent.equals(context)) return false;
if (parent instanceof PsiTryStatement) return true;
if (parent instanceof PsiFile) return false;
parent = parent.getParent();