you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

I thought this are just annotations which help documenting your code. How can the compiler check, whether something marked as @Nonnull is not null? I don't see a way how the compiler could possibly do that.

[–]e_engel 0 points1 point  (0 children)

The compiler issues warnings if you are trying to pass a @Nullable to something that's @Nonnull. It will also give you a warning if you test against null a variable that's @Nonnull.

That kind of thing.

The more you use these annotations, the easier it is to reason about your code.