Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@SuppressWarnings("unused") gives warning: Redundant suppression after Android Studio update

I have a private methods in some low level classes that are not currently in use, but I don't want the "Method x is never used" warning potentially obscuring other more important warnings. I added a standard warning suppression for that method:

    @SuppressWarnings("unused")

Up until recently that was working fine, no warning for that method. After upgrading to AS 4.1.1, however, these have started to get a "Redundant suppression" warning. If I remove the suppression the original unused warning comes back.

I'm using Android Studio 4.1.1 (Nov. 4)

like image 725
William T. Mallard Avatar asked Dec 16 '20 17:12

William T. Mallard


1 Answers

Amusingly, I'm able to work around this by suppressing the suppression warning like so:

    @SuppressWarnings({"unused", "RedundantSuppression"})
like image 169
William T. Mallard Avatar answered Nov 19 '22 04:11

William T. Mallard