3 ms·
> `public @Nullable frobulateWidget(@NotNull frobber)` You can mark the default state. I like to mark everything as NotNull, unless specified otherwise. That w
by kaba0 4y ago
> `public @Nullable frobulateWidget(@NotNull frobber)`
You can mark the default state. I like to mark everything as NotNull, unless specified otherwise. That way only Nullable annotations are needed at the rare occasion null is a valid value.
And I believe it gives you the exact same guarantees as Kotlin, minus the syntactic sugar — nullability is one of the few things that can be statically analyzed.
Most linters also know the standard library’s nullability information, so it’s quite good.