For those who are stuck with a Java project that you can’t port to Kotlin I backported Kotlin’s null safety to Java (meta-annotation, ?. and ?:) : https://github.com/cosee/null4j
👍 1
d
diego-gomez-olvera
12/08/2017, 10:47 AM
There is a
javax.annotation.ParametersAreNonnullByDefault
the difference is that
@NotNullByDefault
support fields and return types?
m
michaelzinn
12/08/2017, 10:50 AM
NotNullByDefault applies to everything, yes.
We experimented with having it not apply to local variables etc. but it was too confusing. Having it apply to everything means it’s just like Kotlin: “String” really means String and “@Nullable String” means String or null, no matter where “String” is actually written.