@Nonnull, @Nullable ... annotations missing in javax.annotation.* package of JME3.1.0 beta1

Hello all,

I have encountered the following problem:

I started a new Java-project using JME3.1.0 (beta1) but I realized that java.annotation.* package
is incomplete or broken: I cannot find the @Nonnull, @CheckForNull, etc… which I frequently use to support static code analysis (findbugs).

Using an older/imported project which has been transferred to JME3.1.0 beta1 everything works fine.

I also compared the project setup of both projects but I couldn’t find any difference.
Changing the java 1.8 platform also didn’t work as well as changing the source format to 1.8

Has anyone an idea how to fix this?

Regards, Harry

@NonNull and such is apparently in the checker framework, which you got to install. Here is a link:
https://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html

Hello, this seems to be exactly what I wanted. Thank you very much. I have downloaded it and currently playing around.
The only problem I have is that I always get Out of memory errors and a very slow reaction of sdk when I enable Nullness checker.
How do you integrate checker in jme3 properly?

Regards,
Harry

I am glad that it is working for you. As for the Out of memory errors, I am not sure where the problem is.

Yes this is quite a problem because CheckerFramework performs very deep and high quality checks.
I think this has something to do with the size of the project but in my opinion it shouldn’t.
NetBeans and findbugs null check are not that reliable because findbugs seems to have problems with nullable fields and NetBeans doesn’t consider default annotations in packages.

Regards harry

How do you perform null checks within your projects or which null checking strategy would you recommend?
In case of CheckerFramework: Which checker class do you use and how?

Regards,
Harry

I have not used null check frameworks yet. For the projects I have done, which were from small to medium size they were not needed. Sometime I do a null check with condition, other times I let a NPE happen.

However, what I could suggest is that you could still use jME3 sdk and try the checker framework with different IDE, eg eclipse. This way you could bypass the out of memory error.