summaryrefslogtreecommitdiff
path: root/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy')
-rw-r--r--java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy28
1 files changed, 28 insertions, 0 deletions
diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy b/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy
index 23eac589e2db..89762efe5dd2 100644
--- a/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy
@@ -228,6 +228,34 @@ class ContractInferenceFromSourceTest extends LightCodeInsightFixtureTestCase {
assert c == []
}
+ public void "test boolean autoboxing in delegation"() {
+ def c = inferContracts("""
+ static Boolean test04(String s) {
+ return test03(s);
+ }
+ static boolean test03(String s) {
+ return s == null;
+ }
+ """)
+ assert c == []
+ }
+
+ public void "test boolean auto-unboxing"() {
+ def c = inferContracts("""
+ static boolean test02(String s) {
+ return test01(s);
+ }
+
+ static Boolean test01(String s) {
+ if (s == null)
+ return new Boolean(false);
+ else
+ return null;
+ }
+ """)
+ assert c == []
+ }
+
public void "test non-returning delegation"() {
def c = inferContracts("""
static void test2(Object o) {