不支持的@SuppressWarnings(“ PMD.DoNotCallSystemExit”) [英] Unsupported @SuppressWarnings("PMD.DoNotCallSystemExit")
问题描述
我需要在应用程序中使用 System.exit(0)
。 Eclipse已安装了PMD插件,并抱怨这一行代码。添加 @SuppressWarnings( PMD.DoNotCallSystemExit)
删除该警告,但现在我收到一条警告,提示不支持此 SuppressWarnings
,尽管事实如此。
I need to use System.exit(0)
in an application. Eclipse has the PMD plugin installed and complains about this line of code. Adding @SuppressWarnings ("PMD.DoNotCallSystemExit")
remove that warning but now I get a warning that this SuppressWarnings
is unsupported, despite the fact that it works.
有没有解决方法?
推荐答案
Eclipse不会标记 @SuppressWarnings( PMD)
批注,请在菜单标题Java->编译器->错误/警告->批注->'
To get Eclipse to not flag the @SuppressWarnings("PMD")
annotation, look under the menu headings Java -> Compiler -> Errors/Warnings -> Annotations -> Unhandled Token in '@SuppressWarnings' and set it to ignore.
在 PMD 页。
这篇关于不支持的@SuppressWarnings(“ PMD.DoNotCallSystemExit”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!