mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't infer ->null contracts in scope of @MethodAreNonNullByDefault (addendum to IDEA-160991)
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ class ContractInferenceInterpreter {
|
||||
contracts = boxReturnValues(contracts);
|
||||
}
|
||||
List<MethodContract> compatible = ContainerUtil.filter(contracts, contract -> {
|
||||
if (contract.returnValue == NOT_NULL_VALUE &&
|
||||
if ((contract.returnValue == NOT_NULL_VALUE || contract.returnValue == NULL_VALUE) &&
|
||||
NullableNotNullManager.getInstance(myMethod.getProject()).isNotNull(myMethod, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+6
-1
@@ -24,10 +24,15 @@ class NotNullClass {
|
||||
return <warning descr="'null' is returned by the method declared as @MethodsAreNotNullByDefault">null</warning>;
|
||||
}
|
||||
|
||||
private Object privateFoo() {
|
||||
private String privateFoo() {
|
||||
return <warning descr="'null' is returned by the method declared as @MethodsAreNotNullByDefault">null</warning>;
|
||||
}
|
||||
|
||||
{
|
||||
String s2 = privateFoo();
|
||||
int i2 = s2.length();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Object foo2() {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user