J2K: Detect @NotNull references in call chains
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user