I want to be aware of all usages of platform types...
# intellij
d
I want to be aware of all usages of platform types. I got a project with NPE issues because of misusing platform types (
?
are lost for unknown reason, maybe during migrations to kotlin or just Java code returns
null
too unexpectedly) I don't understand how kotlin plugin warns about that - I've found only
"Function or property has platform type"
inspection, but i have no warnings at all for this code: Java:
Copy code
public class TestClass {

    private Integer i1;
    private Integer i2;

    public TestClass(Integer i1, Integer i2) {
        this.i1 = i1;
        this.i2 = i2;
    }
}
Kotlin
Copy code
class TestClient {
    val x: Int? = null
    
    fun foo() {
        val java = TestClass(x, x)
    }
}