void ( @NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); @NonNls final String referenceName = methodExpression.getReferenceName(); if (!"valueOf".equals(referenceName)) { 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 (className == null) { return; } if (!boxedPrimitiveMap.containsKey(className)) { return; } if (method.getParameterList().getParametersCount() != 1) { return; } final PsiExpressionList argumentList = expression.getArgumentList(); final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length != 1) { return; } final PsiExpression argument = arguments[0]; final PsiType argumentType = argument.getType(); if (argumentType == null) { return; } final String argumentTypeText = argumentType.getCanonicalText(); if (!className.equals(argumentTypeText)) { return; } registerError(argument); }