mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-136580 "Contract violation" warnings are reported for manual method contract
This commit is contained in:
+1
-1
@@ -625,7 +625,7 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
|
||||
applyEquivalenceRelation(dfaRelation, dfaLeft, dfaRight);
|
||||
return isNegated;
|
||||
}
|
||||
if (canBeNaN(dfaLeft) || canBeNaN(dfaRight)) {
|
||||
if (canBeNaN(dfaLeft) && canBeNaN(dfaRight)) {
|
||||
applyEquivalenceRelation(dfaRelation, dfaLeft, dfaRight);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import org.jetbrains.annotations.Contract;
|
||||
|
||||
class Zoo {
|
||||
@Contract("null, _ -> null; !null, _ -> !null")
|
||||
public static Double testContract_1(Double value1, int value2) {
|
||||
if (value1 == null) {
|
||||
return null;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
@@ -41,4 +41,5 @@ public class ContractCheckTest extends LightCodeInsightFixtureTestCase {
|
||||
|
||||
public void testSignatureIssues() { doTest(); }
|
||||
public void testVarargInferred() { doTest(); }
|
||||
public void testDoubleParameter() { doTest(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user