Closed pfink closed 2 years ago
When I hit save on the flicbutton files my Eclipse auto save actions removed all those unneccessary casts automatically.
The only issue is that you must assign @Nullable
fields to a local variable. That's because another thread can change the value of a field at any time to null
. So if you annotate fields as @Nullable
they can never be inferred as @NonNull
, unless you assign them to a local variable.
Ah okay, that makes sense. Probably I should use Eclipse at least when I do bigger PRs next time ^^
If I cast a
@Nullable
type to a@NonNull
type, a false-positive warning is thrown.Example:
There is no problem with this code, but currently it will wrongly throw the warning:
There is no need for a @NonNull annotation because it is set as default. Only @Nullable should be used