Unnecessary @SuppressWarnings("unused")
Solution 1:
In the code in your question, the @SuppressWarnings("unused")
annotation is unnecessary because the method is either overriding another method from a superclass or implementing an interface. Even if you don't actually use the whatever
parameter it's mandatory to declare it, otherwise the @Override
annotation will produce an error (you'd be changing the signature of the overridden method if you removed the parameter.)
In some older versions of Eclipse the code as shown would not cause a warning, but in more recent releases it does. I believe it's a valid warning, and I'd rather remove the @SuppressWarnings("unused")
in this case.
Solution 2:
Go to
Window → Preferences → Java → Compiler → Errors/Warnings → Annotations.
And select Ignore for Unused '@SuppressWarnings` token.