FIR: use JSR-305 state from command line flags

This commit is contained in:
pyos
2021-08-19 17:17:03 +02:00
committed by teamcityserver
parent bff4b8639b
commit 24210aacc8
19 changed files with 26 additions and 376 deletions
@@ -44,12 +44,12 @@ fun main(a: A) {
a.field<!UNSAFE_CALL!>.<!>length
a.foo2("", null)?.length
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
a.foo2("", null).length
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
a.bar2().length
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.field2?.length
a.field2<!UNSAFE_CALL!>.<!>length
a.field2.length
}
@@ -34,14 +34,14 @@ public class A {
// FILE: main.kt
fun main(a: A) {
a.foo("", null)?.length
a.foo("", null)<!UNSAFE_CALL!>.<!>length
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
a.foo("", null).length
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
a.bar().length
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.field?.length
a.field<!UNSAFE_CALL!>.<!>length
a.field.length
a.foo2("", null)?.length
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
@@ -63,10 +63,10 @@ fun main(a: A) {
a.foo2("", null)?.length
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
a.foo2(null, "")<!UNSAFE_CALL!>.<!>length
a.bar2().length
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.bar2()!!.length
a.field2?.length
a.field2<!UNSAFE_CALL!>.<!>length
@@ -34,14 +34,14 @@ public class A {
// FILE: main.kt
fun main(a: A) {
a.foo("", null)?.length
a.foo("", null)<!UNSAFE_CALL!>.<!>length
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
a.foo("", null).length
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
a.bar().length
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.field?.length
a.field<!UNSAFE_CALL!>.<!>length
a.field.length
a.foo2("", null)?.length
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
@@ -44,12 +44,12 @@ fun main(a: A) {
a.field<!UNSAFE_CALL!>.<!>length
a.foo2("", null)?.length
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
a.foo2("", null).length
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
a.bar2().length
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.field2?.length
a.field2<!UNSAFE_CALL!>.<!>length
a.field2.length
}
@@ -1,35 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
// JSR305_GLOBAL_REPORT: ignore
// JSR305_MIGRATION_REPORT: ignore
// JSR305_SPECIAL_REPORT: MyNonnull:warn, MyMigrationNonnull:strict
// FILE: A.java
import javax.annotation.*;
public class A {
@MyMigrationNullable public String field = null;
@MyMigrationNullable
public String foo(@MyMigrationNonnull String x, CharSequence y) {
return "";
}
@MyNonnull
@MyMigrationNonnull
public String bar() {
return "";
}
}
// FILE: main.kt
fun main(a: A) {
a.foo("", null)?.length
a.foo("", null)<!UNSAFE_CALL!>.<!>length
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
a.bar().length
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.field?.length
a.field<!UNSAFE_CALL!>.<!>length
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
// JSR305_GLOBAL_REPORT: ignore
// JSR305_MIGRATION_REPORT: ignore
@@ -44,12 +44,12 @@ fun main(a: A) {
a.field<!UNSAFE_CALL!>.<!>length
a.foo2("", null)?.length
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
a.foo2("", null).length
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
a.bar2().length
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
a.field2?.length
a.field2<!UNSAFE_CALL!>.<!>length
a.field2.length
}