void (@NotNull PsiAssignmentExpression expression) { super.visitAssignmentExpression(expression); final IElementType tokenType = expression.getOperationTokenType(); if (!JavaTokenType.EQ.equals(tokenType)) { return; } final PsiExpression lhs = PsiUtil.deparenthesizeExpression(expression.getLExpression()); if (!(lhs instanceof PsiReferenceExpression)) { return; } final String type = TypeUtils.expressionHasTypeOrSubtype(lhs, MUTABLE_TYPES); if (type == null && !(lhs.getType() instanceof PsiArrayType)) { return; } final PsiExpression rhs = PsiUtil.deparenthesizeExpression(expression.getRExpression()); if (!(rhs instanceof PsiReferenceExpression)) { return; } final PsiField field = ObjectUtils.tryCast(((PsiReference)lhs).resolve(), PsiField.class); if (field == null) return; final PsiParameter parameter = ObjectUtils.tryCast(((PsiReference)rhs).resolve(), PsiParameter.class); if (parameter == null || !(parameter.getDeclarationScope() instanceof PsiMethod) || ClassUtils.isImmutable(parameter.getType())) { return; } if (ignorePrivateMethods) { final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(expression, PsiMethod.class); if (containingMethod == null || containingMethod.hasModifierProperty(PsiModifier.PRIVATE)) { return; } if (containingMethod.isConstructor()) { final PsiClass containingClass = containingMethod.getContainingClass(); if (containingClass != null && containingClass.hasModifierProperty(PsiModifier.PRIVATE)) { return; } } } registerError(rhs, field, rhs, type, Boolean.TRUE); }