user1294431
user1294431

Reputation: 635

@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.

Upvotes: 11

Views: 2717

Answers (2)

Constantino Cronemberger
Constantino Cronemberger

Reputation: 2261

@SuppressWarnings("ClassExplicitlyAnnotation")

In IntelliJ you can open the context menu and select the "Suppress for class" option.

enter image description here

Upvotes: 0

Bhesh Gurung
Bhesh Gurung

Reputation: 51030

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.

Upvotes: 4

Related Questions