[r=cdr] IDEA-77819∏

This commit is contained in:
Maxim Shafirov
2011-11-29 17:06:49 +04:00
parent 845a45685e
commit 220f762068
6 changed files with 21 additions and 8 deletions
@@ -5,9 +5,4 @@
<line>18</line>
<description>Argument 'obj' might be null</description>
</problem>
<problem>
<file>Test.java</file>
<line>39</line>
<description>Argument 'obj' might be null</description>
</problem>
</problems>
@@ -8,13 +8,13 @@ public class TestNullableIntervening // See http://www.jetbrains.net/jira/brow
this.obj = obj;
}
void foo() {}
@Nullable Object foo() { return null; }
void notnull(@NotNull Object arg) {}
void test1() {
if (obj != null) {
// Method intervening, might change obj; should have warning (OK)
foo();
obj = foo();
notnull(obj);
}
}
@@ -48,4 +48,4 @@ public class TestNullableIntervening // See http://www.jetbrains.net/jira/brow
notnull(obj);
}
}
}
}
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems/>
@@ -0,0 +1,10 @@
public class Test {
public @Nullable String foo;
public void test() {
if (foo != null && foo.length() > 1) {
System.out.println(foo.length());
}
}
}