The Checkers Framework references java.lang.annotation.ElementType.TYPE_USE
which was added in JDK8. When I use it under JDK7, I get the following warning:
unknown enum constant java.lang.annotation.ElementType.TYPE_USE
This is a reasonable warning, but how do I suppress it for cases I believe are harmless?
It turns out there is no such thing as a harmless unknown enum constant. Once I got past the compiler warnings, I ran into exceptions at runtime:
Meaning, any code that uses
java.lang.reflect.Method.getAnnotation()
will fail at runtime.In my case, this issue was caused by https://code.google.com/p/checker-framework/issues/detail?id=255