New J2K: Fix existing test data

This commit is contained in:
Ilya Kirillov
2019-03-26 22:32:42 +03:00
committed by Ilya Kirillov
parent 76b73542d9
commit b13f7431f2
121 changed files with 655 additions and 324 deletions
@@ -0,0 +1,45 @@
package test
class Test {
private var myProp: String? = null
private var myIntProp: Int? = null
fun onCreate() {
myProp = ""
myIntProp = 1
}
fun test1() {
foo1(myProp!!)
}
fun test2() {
foo2(myProp)
}
fun test3() {
foo3(myProp)
}
fun test4() {
myProp!![myIntProp!!]
println(myProp)
}
fun test5() {
val b = "aaa" == myProp
val s = "aaa$myProp"
}
fun test6() {
myProp!!.compareTo(myProp!!, ignoreCase = true)
}
fun test7() {
val list: MutableList<Int> = ArrayList()
list.remove(myIntProp!!)
}
fun foo1(s: String) {}
fun foo2(s: String?) {}
fun foo3(s: String?) {}
}
@@ -0,0 +1,19 @@
class TestJava {
private var notNullInitializerFieldNullableUsage: String? = "aaa"
private var notNullInitializerFieldNotNullUsage = "aaa"
private var nullInitializerFieldNullableUsage: String? = null
private var nullInitializerFieldNotNullUsage: String? = null
fun testNotNull(obj: Any?) {
if (true) {
notNullInitializerFieldNullableUsage = obj as String?
notNullInitializerFieldNotNullUsage = "str"
notNullInitializerFieldNullableUsage!![1]
notNullInitializerFieldNotNullUsage[1]
} else {
nullInitializerFieldNullableUsage = obj as String?
nullInitializerFieldNotNullUsage = "str"
nullInitializerFieldNullableUsage!![1]
nullInitializerFieldNotNullUsage!![1]
}
}
}