Disable warning in IntelliJ for one line

kat picture kat · Oct 17, 2011 · Viewed 39.6k times · Source

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?

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.

Answer

Ryan Stewart picture Ryan Stewart · Oct 17, 2011

Mostly in IntelliJ, you can click on the line and Alt+Enter, and it will have options for suppressing the warning, among other things.