void (@NotNull PsiMethod method) { PsiCodeBlock body = method.getBody(); if (body == null) return; PsiType returnType = method.getReturnType(); LongRangeSet fromType = JvmPsiRangeSetUtil.typeRange(returnType); if (fromType == null) return; LongRangeSet range = JvmPsiRangeSetUtil.fromPsiElement(method); if (range.contains(fromType)) return; PsiReturnStatement[] statements = PsiUtil.findReturnStatements(body); for (PsiReturnStatement statement : statements) { PsiExpression value = statement.getReturnValue(); if (value == null) continue; ExpressionUtils.nonStructuralChildren(value).forEach(expression -> { DfIntegralType val = ObjectUtils.tryCast(CommonDataflow.getDfType(expression), DfIntegralType.class); if (val != null) { LongRangeSet returnRange = val.getRange(); if (!returnRange.intersects(range)) { Long constantValue = returnRange.getConstantValue(); String message = JavaAnalysisBundle .message(constantValue == null ? "inspection.unsatisfied.range.message" : "inspection.unsatisfied.range.message.value", JvmPsiRangeSetUtil.getPresentationText(returnRange, returnType), JvmPsiRangeSetUtil .getPresentationText(range, returnType)); holder.registerProblem(expression, message); } } }); } }