禁用“未使用”对公共方法的警告 [英] Disable "not used" warning for public methods of a class

查看:179
本文介绍了禁用“未使用”对公共方法的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的intellij升级(10.5)现在显示一条警告,指出某些为类定义的方法未被使用。这些方法是公开的,我计划不使用所有这些方法,因为我已创建它们以支持预期的API。我想禁用此警告(不用于类中的公共方法)。有办法吗?

The new intellij upgrade (10.5) now shows a warning that some of the methods defined for a class are not being used. These methods are public and I plan on not using all of them as I have created them to support the API expected. I would like to disable this warning (not used for public methods in a class). Is there a way to do it?.

推荐答案

你可以为这样的单一方法禁用它

You can disable it for a single method like this

@SuppressWarnings("unused")
public void myMethod(){...}

这篇关于禁用“未使用”对公共方法的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆