dsgryazin
01/10/2017, 12:40 PM@NonNull
- nullability contracts in java are broken too often. When I use Kotlin and it says that arguments are ok - I'm sure nullability is ok. Can't say that about java. Often you even don't understand that you call java and that's why I want special inspection.
I see two critical examples:
1. You override Java method. Today Kotlin plugin automatically makes ?
-arguments unless @NonNull
specified, but accidental T!
happens causing NPE.
2. Java method returns value. Kotlin automatically infers T!
and allows using it as nonnull
leading to NPE.
See, platform types too easy to use as nonnull
accidentally, by fault. And there is no help from lint, except "Function or property has platform type"
that doesn't cover all platform types usages.