@Override
  public @NotNull PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
    return new JavaElementVisitor() {
      @Override
      public void visitBinaryExpression(@NotNull PsiBinaryExpression expression) {
        IElementType tokenType = expression.getOperationTokenType();
        if (!ComparisonUtils.isComparisonOperation(tokenType)) return;
        PsiExpression leftOperand = expression.getLOperand();
        PsiExpression rightOperand = expression.getROperand();
        if (rightOperand == null) return;
        boolean equivalent = EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(leftOperand, rightOperand);
        if (!equivalent) return;
        if (PsiUtil.isConstantExpression(leftOperand)) return;
        // Do not repeat the warnings already reported by "Constant values" inspection
        if (Boolean.TRUE.equals(CommonDataflow.computeValue(expression))) return;
        ThreeState wantedStatus = ignoreSideEffectConditions ? ThreeState.UNSURE : ThreeState.YES;
        ThreeState actualStatus = SideEffectChecker.getSideEffectStatus(leftOperand);
        if (actualStatus.isAtLeast(wantedStatus)) return;
        ModCommandAction fix = null;
        if (actualStatus == ThreeState.UNSURE) {
          fix = new UpdateInspectionOptionFix(
            ExpressionComparedToItselfInspection.this, "ignoreSideEffectConditions",
            JavaAnalysisBundle.message("intention.name.do.not.report.conditions.with.possible.side.effect"), true);
        }
        holder.problem(expression.getOperationSign(),
                       JavaAnalysisBundle.message("inspection.message.expression.compared.to.itself.description"))
          .maybeFix(fix).register();
      }
    };
  }
@Override
  public @NotNull PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly)