boolean (PsiReferenceExpression lhs, PsiLoopStatement commonLoop) { while (true) { PsiExpression qualifierExpression = PsiUtil.skipParenthesizedExprDown(lhs.getQualifierExpression()); if (qualifierExpression == null || qualifierExpression instanceof PsiQualifiedExpression) return true; PsiReferenceExpression ref = ObjectUtils.tryCast(qualifierExpression, PsiReferenceExpression.class); if (ref == null) return false; PsiVariable varRef = ObjectUtils.tryCast(ref.resolve(), PsiVariable.class); if (varRef == null) return false; if (PsiTreeUtil.isAncestor(commonLoop, varRef, true) || VariableAccessUtils.variableIsAssigned(varRef, commonLoop)) return false; lhs = ref; } }