Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable warning in IntelliJ for one line

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.

like image 620
kat Avatar asked Oct 17 '11 20:10

kat


People also ask

How do I enable warnings in IntelliJ?

If you do build->rebuild project in IntelliJ, the messages tab (usually at the bottom) should show all the warnings. They should not disappear anywhere even after compiler has finished. If they do, check you have not enabled the "hide warnings" icon on the messages tab.

How do I check warnings in IntelliJ?

If you find a warning in a file, you can inspect your entire project, or the necessary scope of files, to ensure that there are no more such warnings in your code base. From the main menu, select Code | Analyze Code | Run Inspection by Name… or press Ctrl+Alt+Shift+I . Type the inspection name in the popup.


1 Answers

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

like image 95
Ryan Stewart Avatar answered Oct 04 '22 16:10

Ryan Stewart