1

I want to improve my Android projects with Nullness annotations. I read that with the Checker Framework the @NonNull annotation is rarely written, because it is the default. This leads to much cleaner code since you only need to annotate the (hopefully) few types which are @Nullable.

Is it possible to set up Android Studio such that @NonNull is the default type?

I found this answer, but it seems overly complicated and it only does the parameters, so no return types and no fields.

Community
  • 1
  • 1
murf
  • 364
  • 4
  • 17

1 Answers1

0

You can use in android studio 3.0 up version.. in Analyze option you can find Infer Nullity option to set @NonNull or @Nullable automatically...

hope this helps..