After detecting a NPE while testing, I finally wanted to take a look at @Nullable
annotations.
After a small internet search there seems to be a @Nullable
annotation for every IDE or environment:
- Eclipse
- IntelliJ IDEA
- Spring
- Android
- Firebugs (javax.annotation.Nullable)
- ... probably others
I have seen that they seem all to follow JSR-305, which describes this annotation. But the JSR is dormant, see also: What is the status of JSR 305?.
So I have two questions:
- Is there another general annotation which can be used?
- If no, do the IDEs only recognize their own annotations.
- E.g. would it be possible to use the Spring annotations in a non-Spring-project, and Eclipse and IntelliJ can handle the annotation correctly.