diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/UnrollLoopAction.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/UnrollLoopAction.java index f62dc9dda4b0..34c4b740a6dd 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/UnrollLoopAction.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/UnrollLoopAction.java @@ -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; } }