mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[r=cdr] IDEA-77819∏
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user