@SuppressWarnings("unused")发出警告:AndroidStudio更新后的冗余抑制
我在一些当前未使用的低级类中有一个私有方法,但我不希望“方法 x 从未使用过”警告可能掩盖其他更重要的警告。我为该方法添加了标准警告抑制:
@SuppressWarnings("unused")
直到最近,它都运行良好,该方法没有警告。然而,在升级到 AS 4.1.1 后,这些已经开始收到“冗余抑制”警告。如果我取消抑制,原始未使用的警告就会回来。
我使用的是 Android Studio 4.1.1(11 月 4 日)
回答
有趣的是,我可以通过像这样抑制抑制警告来解决这个问题:
@SuppressWarnings({"unused", "RedundantSuppression"})
- @Philip, that's not how the voting works. I think you're supposed to downvote only if there's a problem with the answer, not whether or not you like what the answer is about, no?
THE END
二维码