null-literal argument: do not check nullable parameters with dfa + improve problem description text

This commit is contained in:
Dmitry Batkovich
2016-08-23 17:11:43 +03:00
parent e3fd062cbb
commit 0b95b19068
3 changed files with 3 additions and 2 deletions
@@ -151,7 +151,7 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
for (PsiParameter parameter : NullParameterConstraintChecker.checkMethodParameters(method, isOnTheFly)) {
final String name = parameter.getName();
holder.registerProblem(parameter.getNameIdentifier(),
InspectionsBundle.message("dataflow.method.fails.with.null.argument", name),
InspectionsBundle.message("dataflow.method.fails.with.null.argument"),
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
NullableStuffInspectionBase.getWrappedUiDependentQuickFix(this::createNavigateToNullParameterUsagesFix, parameter, isOnTheFly));
}
@@ -63,6 +63,7 @@ class NullParameterConstraintChecker extends DataFlowRunner {
PsiParameter parameter = parameters[index];
if (!(parameter.getType() instanceof PsiPrimitiveType) &&
!NullableNotNullManager.isNotNull(parameter) &&
!NullableNotNullManager.isNullable(parameter) &&
JavaNullMethodArgumentUtil.hasNullArgument(method, index)) {
nullableParameters.add(parameter);
}
@@ -92,7 +92,7 @@ dataflow.message.return.nullable.from.notnullable=Expression <code>#ref</code> m
dataflow.message.unboxing=Unboxing of <code>#ref</code> #loc may produce <code>java.lang.NullPointerException</code>
dataflow.message.unboxing.method.reference=Use of <code>#ref</code> #loc would need unboxing which may produce <code>java.lang.NullPointerException</code>
dataflow.too.complex=Method <code>#ref</code> is too complex to analyze by data flow algorithm
dataflow.method.fails.with.null.argument=Method fails when parameter ''{0}'' is <code>null<code>
dataflow.method.fails.with.null.argument=Method will throw an exception when parameter is null
#deprecated
inspection.deprecated.display.name=Deprecated API usage