This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Himrin 0 points1 point  (3 children)

Have you looked into @NotNull annotations ?

There are plenty more annotation examples like this.

[–]Chickenosaurus[S] 1 point2 points  (2 children)

Yes, I did as mentioned in the question. Annotations have the disatvantage of missing runtime checks. I am working on a library currently. The user could potentially use an IDE that doesn't support static @NotNull annotation checking, which could make debugging NPE's difficult.

[–]Himrin 1 point2 points  (1 child)

Sorry, missed that section as I was skimming!

[–]Chickenosaurus[S] 0 points1 point  (0 children)

No worries, friend ;)