mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UnrollLoopAction: deprecated method calls replaced
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user