boolean (StreamToLoopReplacementContext context, String bound) { PsiExpression expression = PsiUtil.skipParenthesizedExprDown(context.createExpression(bound)); while (expression instanceof PsiReferenceExpression) { PsiElement ref = ((PsiReferenceExpression)expression).resolve(); if (!(ref instanceof PsiVariable) || !((PsiVariable)ref).hasModifierProperty(PsiModifier.FINAL)) { break; } expression = ((PsiReferenceExpression)expression).getQualifierExpression(); } return !ExpressionUtils.isSafelyRecomputableExpression(expression); }