Adapt changes from main repo:

Detect @NotNull fields
Detect @NotNull reference in call chains
Enum constants are non-nullable
by Andrey Ponomarev
This commit is contained in:
Pavel Talanov
2013-10-04 16:35:47 +04:00
committed by Pavel V. Talanov
parent aceeebdcfd
commit 01a1c75588
5 changed files with 66 additions and 1 deletions
@@ -0,0 +1,22 @@
package test;
import org.jetbrains.annotations.NotNull;
class Foo {
void execute() {}
}
class Bar {
@NotNull
Foo fooNotNull = Foo();
Foo fooNullable = null;
}
class Test {
public void test(@NotNull Bar barNotNull, Bar barNullable) {
barNotNull.fooNotNull.execute();
barNotNull.fooNullable.execute();
barNullable.fooNotNull.execute();
barNullable.fooNullable.execute();
}
}
@@ -0,0 +1,17 @@
package test
open class Foo() {
open fun execute() : Unit {
}
}
open class Bar() {
var fooNotNull : Foo = Foo()
var fooNullable : Foo? = null
}
open class Test() {
public open fun test(barNotNull : Bar, barNullable : Bar?) : Unit {
barNotNull.fooNotNull.execute()
barNotNull.fooNullable?.execute()
barNullable?.fooNotNull?.execute()
barNullable?.fooNullable?.execute()
}
}
@@ -0,0 +1,7 @@
enum E {
FOO;
void foo() {
FOO.toString();
}
}
@@ -0,0 +1,6 @@
enum class E {
FOO
fun foo() : Unit {
FOO.toString()
}
}