void (@NotNull PsiAssignmentExpression assignmentExpression, @NotNull PsiClass outerClass, @NotNull PsiMethodCallExpression generatedCall, @NotNull PsiElementFactory elementFactory) { PsiMethod newMethod = createPsiMethod(FieldAccessType.SET, outerClass, elementFactory); if (newMethod == null) return; outerClass.add(newMethod); PsiExpression rightExpression = assignmentExpression.getRExpression(); if (rightExpression == null) { LOG.warn("Expression representing a new field value not found"); return; } String newValue = rightExpression.getText(); String objectForReference = MemberQualifierUtil.findObjectExpression(myExpression, myField, outerClass, generatedCall, elementFactory); String args = (objectForReference == null ? "null" : objectForReference) + ", " + newValue; String methodCallExpression = newMethod.getName() + "(" + args + ")"; PsiExpression newMethodCallExpression = elementFactory.createExpressionFromText(methodCallExpression, myExpression); assignmentExpression.replace(newMethodCallExpression); }