void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); EqualityCheck check = EqualityCheck.from(expression); if (check == null) return; PsiExpression left = check.getLeft(); PsiExpression right = check.getRight(); if (!TypeConversionUtil.isBinaryOperatorApplicable(JavaTokenType.EQEQ, left, right, false)) { // replacing with == or != will generate uncompilable code return; } final PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(left.getType()); if (aClass != null && aClass.isEnum()) { // Enums are reported by separate EqualsCalledOnEnumConstantInspection return; } final ProblemHighlightType highlightType; if (ClassUtils.isFinalClassWithDefaultEquals(aClass)) { highlightType = ProblemHighlightType.GENERIC_ERROR_OR_WARNING; } else { if (!isOnTheFly()) return; highlightType = ProblemHighlightType.INFORMATION; } final PsiElement parent = ParenthesesUtils.getParentSkipParentheses(expression); final boolean negated = parent instanceof PsiExpression && BoolUtils.isNegation((PsiExpression)parent); final PsiElement nameToken = expression.getMethodExpression().getReferenceNameElement(); assert nameToken != null; registerError(nameToken, highlightType, negated, expression); }