Disable IntelliJ Warnings

It really annoys me that IntelliJ emits certain “errors” (which do not prevent successful compilation) just as real errors are highlighted. For example, a magic number is not really an error, but it will be marked in the same way as an error of an incompatible type.

How can i change this?

+8
intellij-idea
source share
3 answers

go to Settings → Inspections. Then you need to search a long list for an abusive check in which you can get the name by hanging on the warning marker in the margins. You can change the severity of the check, be it a mistake, a warning, etc. Or just turn it off completely.

Edit: if you are looking for “magic” in the settings, you get the following, which should be useful:

enter image description here

+11
source share

Whenever you see a warning / inspection error, you can put a carriage on it and press Alt + Enter (a light also appears that reports this). A menu appears with suggested quick fixes. Perhaps you need to open the submenu by clicking "Right", and there you will find "Edit scan settings." By calling this, you can continue, as in hvgotcodes answer :), this is just a faster way to get to these settings.

+13
source share

As Michael Calvin said, you can use the SuppressWarnings annotation. For example:

@SuppressWarnings("OptionalUsedAsFieldOrParameterType") 

See https://github.com/JetBrains/intellij-community/blob/master/plugins/InspectionGadgets/src/inspectionDescriptions/OptionalUsedAsFieldOrParameterType.html

Usually searching the Internet for an accurate description leads me to this.

+1
source share

All Articles