I have an old Java function in an Android project that is annotated with @NonNull
. A few years after the function was written another developer added a branch that returns null
and forgot to remove the annotation. This was discovered a few months later - I'm surprised the compiler didn't stop that from happening.
What potential issues could this or a similar situation cause, if any? Could this undermine null-safety when interoperating with Kotlin?