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?
Expanding upon Ryan Stewart's answer, in IntelliJ, use Alt+Enter
, then select the first sub-menu, then the last item: Suppress for statement
.
Update
Using IntelliJ IDEA 13, I noticed an additional menu item: "Suppress for statement with comment". This will use the IntelliJ style //noinspection unchecked
. If you select "Suppress for statement", IntelliJ will insert this text: @SuppressWarnings("unchecked")
.