In Java, if you import a deprecated class:
import SomeDeprecatedClass;
You get this warning: The type SomeDeprecatedClass is deprecated
Is there a way to suppress this warning?
In Java, if you import a deprecated class:
import SomeDeprecatedClass;
You get this warning: The type SomeDeprecatedClass is deprecated
Is there a way to suppress this warning?
I solved this by changing the import to:
import package.*
then annotating the method that used the deprecated classes with@SuppressWarnings("deprecation")
If @SuppressWarnings("deprecation") is not working for you like for me. You can find exact squid number in sonar lint plugin. And then you can simply suppress warning: @SuppressWarnings("squid:CallToDeprecatedMethod")