在 IntelliJ 中为一行禁用警告 [英] Disable warning in IntelliJ for one line
问题描述
我有一个 Java 代码行,IntelliJ 在其中显示警告.如何使该特定行中的警告静音,而不影响其他行中显示的警告?
I have a Java code line where IntelliJ displays a warning. How do I silence the warning in that particular line, without affecting warnings displayed in other lines?
在这个问题中,实际警告是什么无关紧要:现在我不是在寻求有关如何提高特定 Java 代码段质量的建议,但我想知道一般如何防止 IntelliJ 显示警告在特定的 Java 源代码行上.
In this question it's irrelevant what the actual warning is: now I'm not seeking advice on how to improve the quality of a specific piece of Java code, but I want to know in general how to prevent IntelliJ from displaying a warning on a specific Java source line.
推荐答案
大部分在 IntelliJ 中,你可以点击行和 Alt+Enter
,它会有抑制警告的选项,其中其他事情.
Mostly in IntelliJ, you can click on the line and Alt+Enter
, and it will have options for suppressing the warning, among other things.
这篇关于在 IntelliJ 中为一行禁用警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!