void (@NotNull PsiMethodCallExpression call) { PsiExpression[] args = call.getArgumentList().getExpressions(); // Avoid method resolve if no argument is a candidate for obvious non-null warning // (checking this is easier than resolving and calls without arguments are excluded at all) if (!ContainerUtil.exists(args, arg -> TrackingRunner.getObviouslyNonNullExplanation(PsiUtil.skipParenthesizedExprDown(arg)) != null)) return; NullCheckParameter nullCheckParameter = NullCheckParameter.fromCall(call); if (nullCheckParameter == null) return; if (!ExpressionUtils.isVoidContext(call) && !nullCheckParameter.myReturnsParameter) return; if (args.length <= nullCheckParameter.myIndex) return; PsiExpression nullArg = PsiUtil.skipParenthesizedExprDown(args[nullCheckParameter.myIndex]); String explanation = TrackingRunner.getObviouslyNonNullExplanation(nullArg); if (explanation == null) return; if(nullCheckParameter.myNull) { holder.registerProblem(nullArg, JavaBundle.message("inspection.redundant.null.check.always.fail.message", explanation)); } else { PsiReferenceExpression comparedToNull = ExpressionUtils.getReferenceExpressionFromNullComparison(nullArg, false); LocalQuickFix fix = comparedToNull == null ? new RemoveNullCheckFix() : new RemoveExcessiveNullComparisonFix(); holder.registerProblem(nullArg, JavaBundle.message("inspection.redundant.null.check.message", explanation), fix); } }