void (@NotNull PsiConditionalExpression ternary) { TernaryNotNullContext context = TernaryNotNullContext.from(ternary); if(context == null) return; String method = getMethodWithClass(context.myNullExpr, false); String name = context.myReferenceExpression.getText(); boolean replacementShorter = name != null && context.myNullExpr.getTextLength() + method.length() + name.length() < context.myTernary.getTextLength() + MINIMAL_WARN_DELTA_SIZE; boolean isInfoLevel = noWarningReplacementBigger && replacementShorter; ProblemHighlightType highlightType = isInfoLevel ? ProblemHighlightType.INFORMATION : ProblemHighlightType.GENERIC_ERROR_OR_WARNING; if (!isOnTheFly && highlightType == ProblemHighlightType.INFORMATION) return; holder.registerProblem(ternary, JavaBundle.message("inspection.require.non.null.message", 2, method), highlightType, new ReplaceWithRequireNonNullFix(method, true)); }