Does Intellij Idea has some inspection to treat all Java types as nullable?

Does Intellij Idea or Kotlin compiler some inspection or feature to treat all Java types as nullable? By default Java type treat as T! and could be nullable or not null. I guess this option will be very useful

1 Like

You could try compiling with the compiler argument -Xjsr305={strict|warn|ignore} set to either strict or warn. Not sure if that will work but it’s the best I could think of. You can find more information about kotlin + JSR 305 here:

https://kotlinlang.org/docs/reference/java-interop.html#jsr-305-support

1 Like