Search code examples
javaannotationssuppress-warnings

@SuppressWarnings value when having an Annotation as superinterface


I have an enum which implements an Annotation and I'm getting the warning: The annotation type A should not be used as a superinterface for MyClass.

Is there a value for @SuppressWarnings which handles this warning? I don't want to use @SuppressWarnings("all"), I'd rather have the warning than suppress all of them.

I'm using Eclipse.


Solution

  • I believe there is no such value for the @SuppressWarnings. If there was such a value then the compiler would have given you a hint on using it along with the warning.

    Since, it doesn't exist, it probably means that it isn't a good idea to make your enum extend an annotation.

    And if you still want to go that way then I think @SuppressWarnings("all") is the only option you have.