UnrollLoopAction: deprecated method calls replaced

This commit is contained in:
Tagir Valeev
2018-12-21 12:30:52 +07:00
parent 21451c6d6d
commit 83593d51a5
@@ -69,7 +69,7 @@ public class UnrollLoopAction extends PsiElementBaseIntentionAction {
for (PsiStatement statement : statements) {
if (isLoopBreak(statement)) continue;
boolean acceptable = PsiTreeUtil.processElements(statement, e -> {
if (e instanceof PsiBreakStatement && ((PsiBreakStatement)e).findExitedStatement() == loop) return false;
if (e instanceof PsiBreakStatement && ((PsiBreakStatement)e).findExitedElement() == loop) return false;
if (e instanceof PsiContinueStatement && ((PsiContinueStatement)e).findContinuedStatement() == loop) return false;
return true;
});
@@ -225,6 +225,6 @@ public class UnrollLoopAction extends PsiElementBaseIntentionAction {
PsiIfStatement ifStatement = (PsiIfStatement)statement;
if (ifStatement.getElseBranch() != null || ifStatement.getCondition() == null) return false;
PsiStatement thenBranch = ControlFlowUtils.stripBraces(ifStatement.getThenBranch());
return thenBranch instanceof PsiBreakStatement && ((PsiBreakStatement)thenBranch).getLabelIdentifier() == null;
return thenBranch instanceof PsiBreakStatement && ((PsiBreakStatement)thenBranch).getLabelExpression() == null;
}
}