简体   繁体   English

IntelliJ IDEA能否显示所有违反Nullable注释的列表

[英]Can IntelliJ IDEA show list of all violations of Nullable annotation

Is there option in IntelliJ IDEA to show list of all java source files where variable or return value of method annotated with @Nullable is used in a code? IntelliJ IDEA中是否可以显示所有Java源文件的列表,其中在代码中使用了@Nullable注释的方法的变量或返回值?

For example, if I want to improve and update all source files with such violations I would like to see list all files (otherwise I have to open each single source and visually inspect highlighted areas) 例如,如果我想改进和更新所有违反此类规则的源文件,我希望列出所有文件(否则,我必须打开每个单独的源文件并目视检查突出显示的区域)

Yes, you should be able to find probable problems/bugs by running a single inspection, via 是的,您应该可以通过运行一次检查来发现可能的问题/错误。

Analyze > Run inspection by name

You might then customize the inspection settings for the single execution. 然后,您可以为单次执行自定义检查设置。

在此处输入图片说明

Those are the inspections you're looking for, most probably. 这些是您最想要的检查。

在此处输入图片说明

Running the inspection "Constant conditions & exceptions returns 运行检查“恒定条件和异常返回

图片

Btw, I'm an inspections maniac for these kind of things, glad to see others do so ;) 顺便说一句,我是这种事情的检查狂,很高兴看到其他人这样做;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM