void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); @NonNls final String methodName = methodExpression.getReferenceName(); if (!"append".equals(methodName)) { return; } final PsiExpressionList argumentList = expression.getArgumentList(); final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length != 1) { return; } final PsiExpression argument = arguments[0]; if (!ExpressionUtils.isStringConcatenation(PsiUtil.skipParenthesizedExprDown(argument)) || PsiUtil.isConstantExpression(argument)) { return; } final PsiMethod method = expression.resolveMethod(); if (method == null) { return; } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null) { return; } final String className = containingClass.getQualifiedName(); if (CommonClassNames.JAVA_LANG_STRING_BUFFER.equals(className) || CommonClassNames.JAVA_LANG_STRING_BUILDER.equals(className)) { registerMethodCallError(expression, containingClass); return; } final Project project = containingClass.getProject(); final JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); final PsiClass appendableClass = psiFacade.findClass("java.lang.Appendable", GlobalSearchScope.allScope(project)); if (appendableClass == null) { return; } if (!InheritanceUtil.isInheritorOrSelf(containingClass, appendableClass, true)) { return; } registerMethodCallError(expression, containingClass); }