void (@NotNull PsiBinaryExpression binOp) { IElementType token = binOp.getOperationTokenType(); RelationType relation = DfaPsiUtil.getRelationByToken(token); if (relation != RelationType.GE && relation != RelationType.LE) return; PsiExpression lOperand = binOp.getLOperand(); PsiExpression rOperand = binOp.getROperand(); if (rOperand == null) return; PsiType lType = lOperand.getType(); PsiType rType = rOperand.getType(); if (!(lType instanceof PsiPrimitiveType) || !(rType instanceof PsiPrimitiveType)) return; if (!TypeConversionUtil.isIntegralNumberType(lType) || !TypeConversionUtil.isIntegralNumberType(rType)) return; if (PsiUtil.isConstantExpression(binOp)) return; CommonDataflow.DataflowResult result = CommonDataflow.getDataflowResult(binOp); if (result == null) return; DfIntegralType leftDfType = ObjectUtils.tryCast(result.getDfType(lOperand), DfIntegralType.class); if (leftDfType == null) return; DfIntegralType rightDfType = ObjectUtils.tryCast(result.getDfType(rOperand), DfIntegralType.class); if (rightDfType == null) return; if (leftDfType instanceof DfConstantType && rightDfType instanceof DfConstantType) return; if (rightDfType instanceof DfConstantType) { DfType leftNarrow = leftDfType.meetRelation(relation, rightDfType); if (leftNarrow.equals(rightDfType)) { holder.registerProblem( binOp.getOperationSign(), InspectionGadgetsBundle.message("inspection.non.strict.comparison.equality.message"), new ReplaceWithEqualityFix(), new FindDfaProblemCauseFix(false, lOperand, new TrackingRunner.RangeDfaProblemType(leftDfType.getRange(), (PsiPrimitiveType)lType))); } } else if (leftDfType instanceof DfConstantType) { DfType rightNarrow = rightDfType.meetRelation(Objects.requireNonNull(relation.getFlipped()), leftDfType); if (rightNarrow.equals(leftDfType)) { holder.registerProblem( binOp.getOperationSign(), InspectionGadgetsBundle.message("inspection.non.strict.comparison.equality.message"), new ReplaceWithEqualityFix(), new FindDfaProblemCauseFix(false, rOperand, new TrackingRunner.RangeDfaProblemType(rightDfType.getRange(), (PsiPrimitiveType)rType))); } } }