I keep getting annoyed by the "Can be private" warning, however my FirebaseRecyclerAdapter
will not work in that case. So, is there a @SuppressWarnings
for that?
What I've tried:
@SuppressWarnings("all")
but that's not what I want.
Note: I am using Android Studio
Use of @SuppressWarnings is to suppress or ignore warnings coming from the compiler, i.e., the compiler will ignore warnings if any for that piece of code. 1. @SuppressWarnings("unchecked") public class Calculator { } - Here, it will ignore all unchecked warnings coming from that class.
The @SuppressWarnings annotation disables certain compiler warnings. In this case, the warning about deprecated code ( "deprecation" ) and unused local variables or unused private methods ( "unused" ).
null to suppress warnings relative to null analysis. restriction to suppress warnings relative to usage of discouraged or forbidden references. serial to suppress warnings relative to missing serialVersionUID field for a serializable class. static-access to suppress warnings relative to incorrect static access.
It is best to simply disable this inspection, either for your whole project or for a specific class. Put your cursor on the warning and press Alt + Enter to bring up the following menu, which allows you to disable it:
If you really want to use @SuppressWarnings
you can choose the Suppress for class
option from the dialog above. This will add the following annotation:
@SuppressWarnings("WeakerAccess")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With