mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[java-dfa] More annotations; annotations for comparators; warn on nullity violation from methodref return
GitOrigin-RevId: d0b1a4967d361f409d4d25562c595e2812fc8044
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5b16802ed3
commit
c3ecaaa190
@@ -61,9 +61,14 @@ public class MethodReferenceInstruction extends ExpressionPushingInstruction {
|
||||
NullabilityProblemKind.callMethodRefNPE.problem(methodRef, null));
|
||||
}
|
||||
List<? extends MethodContract> contracts = JavaMethodContractUtil.getMethodCallContracts(method, null);
|
||||
if (contracts.isEmpty() || !JavaMethodContractUtil.isPure(method)) return;
|
||||
PsiType returnType = substitutor.substitute(method.getReturnType());
|
||||
DfaValue defaultResult = interpreter.getFactory().fromDfType(typedObject(returnType, DfaPsiUtil.getElementNullability(returnType, method)));
|
||||
Nullability expectedNullability = DfaPsiUtil.getTypeNullability(LambdaUtil.getFunctionalInterfaceReturnType(methodRef));
|
||||
if (expectedNullability == Nullability.NOT_NULL) {
|
||||
CheckNotNullInstruction.checkNotNullable(interpreter, state, defaultResult,
|
||||
NullabilityProblemKind.nullableFunctionReturn.problem(methodRef, null));
|
||||
}
|
||||
if (contracts.isEmpty() || !JavaMethodContractUtil.isPure(method)) return;
|
||||
Set<DfaCallState> currentStates = Collections.singleton(new DfaCallState(state.createClosureState(), callArguments, defaultResult));
|
||||
JavaMethodReferenceReturnAnchor anchor = new JavaMethodReferenceReturnAnchor(methodRef);
|
||||
DfaValue[] args = callArguments.toArray();
|
||||
|
||||
Reference in New Issue
Block a user