mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Minor fixes in CFG Stream inlining
1. Initial stream element nullability is derived from type 2. reportNullableArgumentsPassedToNonAnnotated fixed for method references
This commit is contained in:
+5
@@ -551,6 +551,11 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
|
||||
for (PsiElement expr : visitor.getProblems(NullabilityProblem.passingNullableArgumentToNonAnnotatedParameter)) {
|
||||
if (reportedAnchors.contains(expr)) continue;
|
||||
|
||||
if (expr.getParent() instanceof PsiMethodReferenceExpression) {
|
||||
holder.registerProblem(expr.getParent(), "Method reference argument might be null but passed to non annotated parameter");
|
||||
continue;
|
||||
}
|
||||
|
||||
final String text = isNullLiteralExpression(expr)
|
||||
? "Passing <code>null</code> argument to non annotated parameter"
|
||||
: "Argument <code>#ref</code> #loc might be null but passed to non annotated parameter";
|
||||
|
||||
+1
-1
@@ -317,7 +317,7 @@ public class StreamChainInliner implements CallInliner {
|
||||
.chain(firstStep::before)
|
||||
.doWhile()
|
||||
.pushVariable(builder.createTempVariable(inType))
|
||||
.push(builder.getFactory().createTypeValue(inType, Nullness.UNKNOWN))
|
||||
.push(builder.getFactory().createTypeValue(inType, DfaPsiUtil.getTypeNullability(inType)))
|
||||
.assign()
|
||||
.chain(firstStep::iteration)
|
||||
.endWhileUnknown();
|
||||
|
||||
Reference in New Issue
Block a user